Update to JDK 17 (#1394)

Everything still targets JDK 8 (non-records) or JDK 16 (records only)
This commit is contained in:
Zac Sweers
2021-10-16 02:18:51 -04:00
committed by GitHub
parent 2db351f8ed
commit 862ff7ddcd
4 changed files with 14 additions and 8 deletions

View File

@@ -29,9 +29,10 @@ val java16 by sourceSets.creating {
}
tasks.named<JavaCompile>("compileJava16Java") {
// We use JDK 17 for latest but target 16 for maximum compatibility
javaCompiler.set(
javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(16))
languageVersion.set(JavaLanguageVersion.of(17))
}
)
options.release.set(16)

View File

@@ -18,7 +18,14 @@ plugins {
`java-library`
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks.withType<JavaCompile>().configureEach {
// Target 16 to ensure minimum compatibility
options.release.set(16)
}