Hello,
i had the idea to check the value of some ext properties after the configuration phase has been finished. So i added a taskGraph.whenReady handler. But i wondered why the handler doesn’t see ext properties that have been changed in the configuration. See this example:
ext {
myProp = 'initial'
}
task MyTask() {
println "MyTask config 1: $myProp"
ext.myProp = 'Now changed'
println "MyTask config 2: $myProp"
}
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(MyTask)) {
println "whenReady: $myProp"
}
}
The output is
C:\temp>gradle MyTask
MyTask config 1: initial
MyTask config 2: Now changed
whenReady: initial
:MyTask UP-TO-DATE
BUILD SUCCESSFUL
Total time: 4.582 secs
The whenReady{} has still the initialization value set. I’m certainly missing something, but what?