So, I've been trying to avoid build tools for a while, but started to use Gradle for some time now. I'm able to use it for simple things like letting it download dependencies, like it's intended, but I've seen people use it to do really advanced staff like manage large projects with different modules, native dependencies, publish to Github when building, etc.
I feel like I still need to copy-paste a lot when trying to do anything more complicated, because even after finding some documentation to read, I'm still not sure where language syntax like {, }, :, (, ), are meant to be used.
So, my question is: Does it make sense to learn Groovy to understand Gradle better? Should reading the docs be enough? I'm not even asking because I would not be interested in Groovy, I'm just wondering how people got used to using Gradle and whether it makes sense to use it for more advanced tasks then fetching dependencies from repositories.
gradle is a Groovy script. Thus it can execute arbitrary code and access any Java library, build-specific Gradle DSL and the Gradle API.
Gradle, the build automation tool for multi-language software development that is widely used for Android is notoriously difficult to use.
Gradle and Groovy are primarily classified as "Java Build" and "Languages" tools respectively. "Flexibility" is the primary reason why developers consider Gradle over the competitors, whereas "Java platform" was stated as the key factor in picking Groovy. Gradle and Groovy are both open source tools.
It is popular for its ability to build automation in languages like Java, Scala, Android, C/C++, and Groovy. The tool supports groovy based Domain Specific Language over XML. Gradle provides building, testing, and deploying software on several platforms.
Gradle uses DSL (domain specific language) that is currently based on top of Groovy. That means, that you should be able to work with Gradle to some extend by learning the DSL only. It, of course, inherits some of the syntax from Groovy (like the parentheses etc) but the syntax pretty far away from a normal Groovy code.
If you want to start writing your own closures, tasks and plugins then you need some Groovy skills, yes. Groovy in Action 2nd edition is a great book, or if you are a Java developer, take a look at Making Java Groovy.
Saying that, please keep in mind that Gradle Inc announced that they are going to support Kotlin as another language to base the DSL on. It means that you will be able to write the "custom" parts of your build in Kotlin or Groovy. So, keep an eye on Kotlin as well, here's the best way to do it – Kotlin in Action.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With