I am about to finish Building and Testing with Gradle. Quite an impressive piece of software, the Groovy-based Gradle. I like how it is (somewhat) procedural (like Ant), somewhat declarative (like Maven), easy to alter (like MSBuild) and based on a clear concept of interdependent units of work (like make).
Once you understand a few notions such as project, task and dependency, that’s pretty much it. Everything else can be explored with ease. For example, one can write a try.gradle inspecting little script:
task disect << {
def t = tasks[System.properties['what']]
t.properties.sort{it.key}.each {
println sprintf('%1$-23s ==> %2s', "${it.key}", "${it.value.toString()}")
}
}
and then run gradle -b try.gradle disect -Dwhat=tasks to obtain the properties of task ‘tasks’ (-Dwhat controls which task to inspect):