How to print javac compiling command when executing gradle build


(leo Y) #1

Hi,

I am using gradle to build Android apk files. When I run the command ‘./gradlew assembleRelease’, I would like to print the real javac compiling command in the stdout to see how java files are compiled into class files
.
Could anyone give some hint? Thank you in advance.

-Leo


(uklance) #2

Something like

tasks.withType(JavaCompile) {
   doFirst {
      println "Args for for $name are $options.allCompilerArgs"
   }
} 

See https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/compile/CompileOptions.html