Open In App

Introduction to Gradle

Gradle is an excellent open-source construction tool that is capable of the development of any kind of software. This tool was developed by a gaggle of developers named Hans Dockter, Szczepan Faber Adam Murdoch, Luke Daley, Peter Niederwieser, Daz DeBoer, and Rene Gröschkebefore 13 years before. It is an automation tool that is based on Apache Ant and Apache Maven. This tool is capable of developing applications with industry standards and supports a variety of languages including Groovy, C++, Java, Scala, and C. Gradle also is capable of controlling the development tasks with compilation and packaging to testing, deployment, and publishing. 

History of Gradle

Gradle is the most stable tool when is compared to the Ant and Maven. This tool was released in late 2007 initially as an alternative for predecessors which not only replaced them but also covered the drawbacks for them. Its stable version was released in the year 2019 and now is currently with the latest version 6.6. 



Working of Gradle

The Gradle project when constructed it consists of one or more than one project. These projects consist of tasks. Let us understand the basics of both terms.

1. Gradle Projects: The projects created by Gradle are a web application or a JAR file. These projects are a combination of one or more tasks. These projects are capable to be deployed on the various development life cycles. A Gradle project can be described as building a wall with bricks N in number which can be termed as tasks. 



2. Gradle Tasks: The tasks are the functions which are responsible for a specific role. These tasks are responsible for the creating of classes, Javadoc, or publish archives into the repository which makes the whole development of the Gradle project. These tasks help Gradle decide what input is to be processed for a specific output. Again tasks can be categorized into two different ways: 

Example: Printing Welcome to GeeksforGeeks! with a task in Gradle.  




build.gradle : task hello
{
    doLast
    {
        println 'Welcome to GeeksforGeeks!'
    }
}

Output: 

> gradle -q hello
Welcome to GeeksforGeeks!

Features of Gradle:

Pros of using Gradle

Cons of using Gradle


Article Tags :