Before reading this, take note that I’m not by any means an Android development professional. At my daily job I don’t even code. The must similar thing that I do is create SQL queries and run them. My point is: take this post with a grain of salt. Actually, mind all my posts, because I’m just a random person with a blog!
I’m not sure this will be the beginning of a series of this kind of posts or not, but I always wanted to write these mini tutorials. I love to learn new stuff, but sometimes, explanations that you find online assume that you either have some previous experience or bombard you with terms so complex that after a few lines you just give up and fire up steam to hide from the world. There’s no middle term.
Hence, ELI5. Not trying to dumbify anything, but sometimes it’s good to have a really beginners guide to something. Today I’ll write a brief explanation about Gradle.
So, what’s Gradle?
I said before that jumping into a guide that requires previous experience is sometimes demotivating. I’m not saying you need experience, but know that I’m writing about one of the basics of Android development.
In short, Gradle is a build tool with a focus on build automation and support for multi-language development.
Ok, but what do you mean with build tool?
Any computer program, in our case, an app originates from source code. A build tool help us in development by cutting some steps in the compilation process. This means it help us with the tedious to be process of transforming our hand written raw code into an APK.
For the Java language, the main language used in Android development, the main build tool is called Ant. Ant (acronym for Another Neat Tool) is maintained by Apache Software Foundation. You may know them for other great software like Open Office.
Many computer programs do similar things. Innumerable other software developers have already written common, useful code and made it available for public re-use so we don’t have to re-write the same thing they did. They make this code available as a “library” and when we re-use it it becomes a “dependency” of our program. Maven is a utility program that makes it easier to depend on these libraries by simply listing in a file what libraries we want to use. They are then automatically located, downloaded, and built into our program or app by the build system.
Ant + Maven = Gradle
So what Gradle does is combine Ant and Maven and let’s you configure them together, rather than working them as individual tools. This leads to a simplification of complex and repetitive tasks that happen when working with both.
This is it. This post was only meant to be a brief introduction to Gradle and the “history” beyond it. I’ll follow it with a new one that goes a bit deeper, with technical concepts, build phases and what does Gradle really looks like in real life.