Gradle is a new face in the world of Java build tool. There aren't much book resources available now. But the official document is awful, I am keep looking for in depth books about the subject.
The very first book is "Building and Testing with Gradle". But its a little book and only scratches the surface of the subject.
One of the greatest feature of modern build tool is the dependency management. Dependency management can be acknowledged as one of the best feature of Maven . Gradle makes it goes to next level.
In Gradle , dependencies is represented by configurations. A configuration is a named set of dependencies.
Every task has a type, for example copy, jar package, execute external programs and so on.
The type of task is determined by the implementing task class:
The subprojects is a TreeSet object, the element is Project object. To configure selected subprojects, using grep or findAll to filter projects.
In the closure, code before -> is the parameter, after that is the closure code. The code check every project's name properties, if it not contains "shared" string, add it to ext.webProjects.
A task in gradle is an object. Object can have properties and methods, just like any other objects.
Any task you defined is not an empty object, it already contains some properties and methods. Because each new task inherit from DefaultTask.