I’m having a hard time understanding the behaviour of the following build script (using gradle 1.11) while trying to set the showStandardStreams property for unit test execution. My complete build script is as follows:
apply plugin: 'java'
test {
boolean b = false
println "Property value before set: " + testLogging.showStandardStreams
testLogging.showStandardStreams = b
println "Property value after set: " + testLogging.showStandardStreams
}
If you then execute a gradle task (for example, ‘test’), the following output is produced:
Property value before set: false Property value after set: true :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE
BUILD SUCCESSFUL
I’ve tried setting the property to have a Boolean type (rather than the intrinsic boolean), and even setting it to itself, but nothing makes a difference: as soon as the property is assigned, it becomes true.
Thanks for any insight,
Tom