Gradle has already provided a very powerful DSL for build developer, for example, the way you declare dependencies is defined by Gradle as a DSL syntax.
Its really more readable than Maven or other build tools.
The 'group' is a built in property in each task. When set, the task list will be present by their group name, make it easier to browse the list.
Lets set this property in our task
A build tool is all about manipulating files, it compiles source files, packages artifact files, resolves dependencies files, copy files, deletes temporary files. Its not surprise that many Gradle class accepting and generating files.
Represent files is a very important part of a great build tool. Gradle contains many utilities to allow you manipulate the file easily and flexibly.
Configuration is a fundamental concept in Dependency management of Gradle. The name "configuration" may be not so intuitive . Actually , its just a list of file, the file is your dependencies files, it could be in your local cache, or in a repository host on a web server.
There is a little problem with the Eclipse Gradle project plugin. It may confuse people at some point.
I was trying to test the redis client for Java. And the dependency in gradle.build looks like this.
Usually, the ext in gradle build script is used to define constants. For example, the version.
In C++, you may use the const variable or #define macro. When the value changes, only one place need to be changed.
The buildscript is used to configures the classpath for current build.gradle script file. The repositories and dependencies defined inside buildscript closure are used by gradle script, for example, apply a third party plugin.
The repositories and dependencies outside buildscript closure are used by your project, for example the Java sources.
Gradle supports Ant very well through its AntBuilder, actually you can use Gradle as a wrapper of Ant script. The closure of Groovy language strong resemble the Ant XML syntax.
When call Ant task in Gradle, the first parameter is a map which correspond to the attributes of the task element. For example