Gradle Tutorial


Gradle is an open source, advanced general purpose build management system. It is built on ANT, Maven, and lvy repositories. It supports Groovy based Domain Specific Language (DSL) over XML. This tutorial explains how you can use Gradle as a build automation tool for Java as well as Groovy projects.

Prerequisites

Gradle is a Groovy-based build automation tool. So, it will certainly help if you have some prior exposure to Groovy. In addition, you should have working knowledge of Java.

JDK and Groovy are the prerequisites for Gradle installation.
  • Gradle requires JDK version 6 or later to be installed in your system. It uses the JDK libraries which is installed and sets to the JAVA_HOME environmental variable.
  • Gradle carries its own Groovy library, therefore, we do no need to install Groovy explicitly. If it is installed, that is ignored by Gradle.
Following are the steps to install Gradle in your system.

Step 1 − Verify JAVA Installation

First of all, you need to have Java Software Development Kit (SDK) installed on your system. To verify this, execute Java –version command in any of the platform you are working on.

In Windows −

Execute the following command to verify Java installation. I have installed JDK 1.8 in my system.
C:\> java - version
If the command is executed successfully, you will get the following output.
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)

In Linux −

Execute the following command to verify Java installation. I have installed JDK 1.8 in my system.
$ java - version
If the command is executed successfully, you will get the following output.
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)
We assume the readers of this tutorial have Java SDK version 1.8.0_66 installed on their system.

In Mac OS −

$ brew install gradle

Step 2 − Download Gradle Build File

Download the latest version of Gradle from the Download Gradle link. In the reference page, click on the Complete Distribution link. This step is common for any platform. For this you will get the complete distribution file into your Downloads folder.

Comments

Post a Comment

Popular posts from this blog

GitHub Administration