Skip to content

Commit

Permalink
invert java 11/17 toolchains configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tnielens committed Sep 11, 2024
1 parent bea4726 commit 248d081
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 248d081

Please sign in to comment.