// Explicitly wire the compiler to the task
tasks.withType(JavaCompile).configureEach {
def targetVersion = project.hasProperty('useJava8') ? 8 : 21
// This forces the task to look up the compiler from the toolchains Gradle found
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(targetVersion)
}
println "Task ${name} is using compiler version: ${targetVersion}"
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)