Introduction to Gradle
What is gradle
According to Gradle Inc, Gradle is an open-source build automation tool that is designed to be flexible enough to build almost any type of software.Here are the five things you need to know about gradle.
Gradle was chosen by Google as the official build tool for Android. Find out why.
Build tools are programs that automate the creation of executable applications from source code. Building incorporates compiling, linking and packaging the code into a usable or executable form. In small projects, developers will often manually invoke the build process.
Read up on the major differences between the following Java Build Tools Gradle vs Maven
Your first Gradle application
- Open Project Wizard, in the left-hand pane select Gradle.
- In the right-hand pane, IntelliJ IDEA automatically adds a project SDK (JDK) and a default option Java in the Additional Libraries and Frameworks area. Click next.
- On the next page of the wizard let’s specify ArtifactId as test.project which basically is the name of our project. We can use the default information in the version field. Unless we plan to deploy our project in some Maven repository we don’t need to specify a GroupId. Click next.
- In the Project tool window open the src folder.
- Right-click the main directory then the java subdirectory and from the list select New | Java Class.
- In the Create New Class dialog specify the name of your Java Class as Gradle and click OK.
- Add the following code in your Java Class
public class Gradle{
public static void main(String[] args){
String gradle = "Introduction to Gradle!";
System.out.println(gradle);
}
}
- In the editor, in the left gutter, press icons toolwindows toolWindowRun svg and select Run ‘HelloGradle.main()’.