What is Gradle ? How Gradle Build Tool Works | How its different from Maven? | DevOps | InterviewDOT
Channel: Interview DOT
Date: 2020-02-18

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications.

Tamil What is Gradle? How is it different from Maven? | DevOps | InterviewDOT

What is Gradle?
Gradle is a build automation tool often used for JVM languages such as Java, Groovy or Scala. Gradle can be configured to run Tasks which do things like compile jars, run tests, create documentation and much more.

For example, the simple task to copy some files from one directory to another can be performed by Gradle build script before the actual build process happens.

Gradle is an open-source build-automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.

The Core of Gradle: Projects and Tasks
Now we have a better understanding of how groovy syntax works let’s take a deeper look at the build.gradle file.
The build.gradle file has a one to one relationship with something called the project object: It’s an object representing information about our project. If you’ve used Maven before (another popular build tool Gradle aims to be compatible with) you’ll recognise this idea from the pom.xml file (project-object-model), this is roughly equivalent to build.gradle.
Each project is made up of a collection of Tasks: these are atomic units of work that represent the things that need to be done to build our project.
Gradle has a number of default Tasks on the project object model — we can have a look at these by running the task:

gradle tasks

Properties
As well as Tasks, our project object also has “properties” that represent information about our project. These can be simple properties such as the version or the sourceCompatibility, 


Customising Tasks
We can do the same customising magic with Tasks too. When building my Tic Tac Toe command line application I was looking for some way of running it conveniently from Gradle — the application plugin had a handy task called run.