diff options
author | AlisaLinUwU <alisalinuwu@gmail.com> | 2025-01-26 11:47:38 +0500 |
---|---|---|
committer | AlisaLinUwU <alisalinuwu@gmail.com> | 2025-01-26 11:47:38 +0500 |
commit | 4154d33fcdfbe8eefc66149e4a13d41a814a5abd (patch) | |
tree | 1d7474bc7dc04b90fd1d705d607e8bb76341e50a /build.gradle |
Initializemain
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..06dd509 --- /dev/null +++ b/build.gradle @@ -0,0 +1,69 @@ +apply plugin: 'hyperskill' + +subprojects { + apply plugin: 'application' + apply plugin: 'java' + + def userJava = Integer.parseInt(JavaVersion.current().getMajorVersion()) + def hsJava = Integer.parseInt(hs.java.version) + def testJava = Math.max(userJava, hsJava) + + java.toolchain.languageVersion = JavaLanguageVersion.of(testJava) + + compileJava { + javaCompiler = javaToolchains.compilerFor { + languageVersion = JavaLanguageVersion.of(userJava) + } + } + + compileTestJava { + javaCompiler = javaToolchains.compilerFor { + languageVersion = JavaLanguageVersion.of(testJava) + } + } + + repositories { + mavenCentral() + maven { url "https://jitpack.io" } + } + + dependencies { + testImplementation 'com.github.hyperskill:hs-test:release-SNAPSHOT' + } + + configurations.all { + resolutionStrategy.cacheChangingModulesFor 0, 'seconds' + } + + sourceSets { + main.java.srcDir 'src' + test.java.srcDir 'test' + } + + test { + systemProperty "file.encoding", "utf-8" + outputs.upToDateWhen { false } + } + + compileJava.options.encoding = 'utf-8' + tasks.withType(JavaCompile) { + options.encoding = 'utf-8' + } +} + +project(':util') { + dependencies { + implementation 'com.github.hyperskill:hs-test:release-SNAPSHOT' + } +} + +configure(subprojects.findAll {it.name != 'util'}) { + dependencies { + testImplementation project(':util').sourceSets.main.output + testImplementation project(':util').sourceSets.test.output + } +} + +wrapper { + gradleVersion = hs.gradle.version +}
\ No newline at end of file |