In my previous post I went over some basic terms used by Gradle and the Android build system, and over the flow of the build. With these understandings at hand, we are now ready to go over concrete steps and set up our build server, without Android Studio, or in fact without any GUI tools at all.
For the sake of this post I will assume you are setting up your new build environment on a Linux server, and you don’t have the Linux GUI at your service, only the command line. Of course, it can all be set up on a Windows or Mac machine just as well.
Let’s also assume that your user on the build machine is called “user”, and therefore your typical home directory would be /home/user.
Now let’s go step by step:
1. Download and install the JDK
First download the JDK you work with. I have downloaded JDK7 from Oracle’s site. If your Linux environment doesn’t support rpm – you will need to download the tar.gz version and extract it, for example to /home/user/.
2. Download and install Gradle
You can download Gradle’s latest release from here. The binary distribution will do, no need for the complete distribution. I chose to use Gradle 2.4.
By the way, There is the option of avoiding the explicit installation of Gradle if you are using the Gradle Wrapper, but let’s leave this topic aside. Personally I think that if you are setting up your build server, the better approach is to explicitly download the Gradle version you want. Once downloaded, extract the zip file, for example under /home/user.