I have been using Gradle for a week now and wanted to share my impressions about it.
If I got something wrong, let me know and I'll update the post.
Gradle [www.gradle.org] is a fairly new build scripting language. It is written in Groovy and Java.
Java is used to implement some heavy lifting under the hood as well as create tight integration with Ant and Ivy.
Groovy is one of the languages that allows you to define so called Domain Specific Language so that you could use it to define dependencies, properties and algorithms for building your projects. Idea behind a DSL is to hide unnecessary complexity of the platform and provide you just what you need so that your configuration/script files would be as condensed and precise as possible.
The result is interesting, they managed to deliver the same flexibility and power that you get from Ant, but Gradle also provides you some features that Maven has - declarative dependencies for external libraries and between your modules.
So basically it's like bringing the good stuff from Ant and Maven as one build system.
But that is not all. In addition to this, Gradle is more flexible than Maven when it comes to dependencies. You have better control over which dependencies are transitive and which are not, you can fix POM.xml issues such as if someone declared a runtime dependency instead of compile time dependency in one of the libraries that you are trying to use. I think you also can have libraries that consist of multiple artifacts.
Some people don't like Ant because it's not a scripting language, but it's trying to function like one because of the nature of things that are expected from a build system. Those people will definitely like Gradle.
Some people don't like Maven because it's too restrictive and you have to spend a lot of time fighting with it if your needs are a little different than what the most standard build is. This is definitely not a problem with Gradle.
Gradle's week moments for me were:
- Gradle is not as mature as Ant or Maven. These guys have been around for many years. Hopefully Gradle will get there soon. I am talking about level of logging it gives - I don't think the dials to control that doesn't give you enough flexibility - I often needed to restart my build with different parameters to see what went wrong during the build.
- Lack of integration with IDEs. E.g. IntelliJ IDEA supports Maven POM files and Ant build files almost as well as native project descriptors (allows importing them and can generate some of them, also syntax highlighting and suggestions) - I understand that this is just because Gradle hasn't been around long enough, but I'd like to see that improving soon.
- I'd like to see more documentation and examples.
One thing we want to do differently with our logging is to make the default logging less verbose than the Maven one. Otherwise we think important warnings/problems are easily hidden by the noise of the default logging. One consequence of that is, that if you run into an error, you might need to run it with a different log level to figure out what has happened. For 0.8 we have improved the error reporting you get for any log level. Another possible approach is to allow logging to additionally to a file with a more verbose log level. We are open to any good ideas in this field. So please don't hesitate to start a discussion on our mailing list.
ReplyDelete--
Hans Dockter
Gradle Project Manager
http://www.gradle.org