Closed C-Otto closed 3 years ago
This is in the works. In the mean time, you can use:
tasks.withType<JavaCompile>().configureEach {
options.isFork = true
options.forkOptions.jvmArgs!!.addAll(listOf(
"--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
"--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
"--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"
))
}
(this is with the Kotlin DSL, adapt for Groovy DSL)
Done, and released in v2.0.0
According to https://errorprone.info/docs/installation some flags seem to be necessary when using JDK 16. I have no idea how to configure those with Gradle and I'd appreciate some plugin support.