Welcome to a new blog series where I aim to cover the basics of Gradle, the build tool that not just everyone is talking about but adopting widely. Companies, small and large have adopted this tool and while you might be familiar with Ant and Maven, it is time to take a look at Gradle.
Jan 22, 2015 : UPDATE: The series has been updated for the Android Studio 1.0.2 and the latest versions of all the Gradle plugins
The need for writing this series has come about primarily due to my work with a few Google related technologies/frameworks. I use the Google Cloud Platform widely for my projects (both professional and hobby) and have primarily used Eclipse as my IDE for both Cloud Projects (running on Google App Engine) and front-end mobile applications (Android). With Google putting its weight behind Android Studio, one of the things that hit me immediately when I tried to use Android Studio was the fact that it used Gradle as its build tool.
My first experience with Android Studio and Gradle was one that cannot be described. I do not want to digress from the topic at hand, but let’s say that it was a difficult time to understand the exceptions, what Gradle is doing in the background and how to correctly set up dependencies of already existing projects. If you have been trying to play with Gradle, you know exactly what I mean. This series is my attempt to explain just about enough of Gradle so that you can get going with minimum fuss and save loads of time. In fact, I am confident that the more you use Gradle, the more you will appreciate the reasons for using it and which was not very apparent to me, the first time I experienced all those problems.
The series will be more task focused with just enough explanation for you to understand what is going on behind the scenes. I will spend less time on marketing Gradle. I will not go deep into reasons on why it works in a certain way. I will reference articles at the right places for those who wish to take a deeper dive. For the rest of us, who are interested in using Android Studio + Google Cloud Platform , we want to be as comfortable with the toolset, so that we can continue to build great applications and let Gradle do the heavy work of the mechanics that eventually result in binaries that we can give to the world.
This tutorial series will take you to a journey that covers the following:
- Part 1 : Installation of Gradle and setting it up correctly on your system
- Part 2 : Your first Java Project Build with Gradle
- Part 3 : Multiple Java Projects with Gradle
- Part 4 : Java Web Applications with Gradle
- Part 5 : App Engine Gradle Plugin
- Part 6 : Gradle + Android Studio
- Part 7 : Gradle + Android Studio + App Engine
- Part 8 : Gradle + App Engine + Cloud Endpoints + Android Studio
- Part 9 : Gradle + App Engine + Cloud Endpoints (Persistence) + Android Studio
- Part 10 : Consuming Endpoints in your Android application
Some of these parts could go over into multiple parts, but at a high level, this is what I plan to cover. If you notice, the first 4 parts will focus on Gradle basics without getting into any specific Google stuff ( Google App Engine , Android, Android Studio IDE, etc).
To all Java Developers out there, lets rock the Gradle !