Skip to content

Commit

Permalink
Merge pull request #38 from tnielens/invert-toolchain-configuration
Browse files Browse the repository at this point in the history
invert java 11/17 toolchains configuration
  • Loading branch information
wakaleo authored Sep 13, 2024
2 parents bea4726 + 248d081 commit 279fbd1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ repositories {
}
}

// test classes require java 17
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(11)
}
}
// main code can be published with back to java 11 support
tasks.named("compileGroovy").configure {
javaLauncher = javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(11)) }
// test classes require java 17
tasks.named("compileTestJava", JavaCompile) {
javaCompiler = javaToolchains.compilerFor { languageVersion = JavaLanguageVersion.of(17) }
}
tasks.withType(Test) {
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(17) }
}


Expand Down

0 comments on commit 279fbd1

Please sign in to comment.