Move Toolchain Config Outside Compile and Test tasks

Issue gh-13811
This commit is contained in:
Marcus Da Coregio 2023-09-21 16:49:12 +01:00
parent 872de2f20f
commit 6d318914d5
1 changed files with 5 additions and 15 deletions

View File

@ -131,25 +131,15 @@ def toolchainVersion() {
}
subprojects {
def toolchainVersion = toolchainVersion()
java {
toolchain {
languageVersion = JavaLanguageVersion.of(toolchainVersion())
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
java {
toolchain {
languageVersion = JavaLanguageVersion.of(toolchainVersion)
}
}
}
tasks.withType(Test).configureEach {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(toolchainVersion)
}
}
}
}