Skip to content

Commit

Permalink
Move Toolchain Config Outside Compile and Test tasks
Browse files Browse the repository at this point in the history
Issue gh-13811
  • Loading branch information
marcusdacoregio committed Sep 21, 2023
1 parent 872de2f commit 6d31891
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}

Expand Down

0 comments on commit 6d31891

Please sign in to comment.