Skip to content
Advertisement

How can I set the compileOptions for my Gradle Java plugin?

I want to set the -parameters command on my gradle build so that I can use reflection to access the name of the parameters. It seems like I should be doing this with the following closure.

JavaScript

But compileOptions is listed as read-only, and when I look at the source code there’s no setter.

https://gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html#org.gradle.api.tasks.compile.JavaCompile:options

How am I suppose to be able to tell the javac compiler what args to use in Gradle?

JavaScript

Advertisement

Answer

Please try:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement