I’ve got my JavaCompile tasks defined as below:
subprojects {
tasks.withType(JavaCompile).all {
it.options.encoding = 'iso-8859-1'
it.sourceCompatibility '1.5'
it.targetCompatibility '1.5'
it.options.fork(memoryInitialSize: "1G", memoryMaximumSize: "1G")
it.options.debug = true
it.options.deprecation = false
it.options.incremental = true
it.doLast {
println "################ " + options.debugOptions.debugLevel
}
}
}
The ‘debugLevel’ gets printed out is always ‘null’.
However, by looking at the generated class file, I can see that it include all the debugging information ,i.e. source, lines and vars. This was fine until I checked out the documentation of ‘DebugOptions.getDebugLevel()’ method. It says the following at the end:
By default, **only source and line** debugging information will be generated.
Assume the above statement is correct, then ‘options.debugOptions’ should not be null when ‘options.debug=true’ and should be set to ‘source,lines’. Otherwise, the documentation of ‘getDebugLevel()’ method should be updated to reflect the acutal behaviour.
Or am I miss understanding something here?