Getting Started Gradle - c4rlosc7/wiki GitHub Wiki


Gradle is an open-source build automation tool that is designed to be flexible enough to build almost any type of software.

Gradle runs on the JVM and you must have a Java Development Kit (JDK) installed to use it. This is a bonus for users familiar with the Java platform as you can use the standard Java APIs in your build logic, such as custom task types and plugins.

Getting Started

Prerequisites

  • JDK Java 1.8 or higher
❯ java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

Gradle ships with its own Groovy library, therefore Groovy does not need to be installed

Install

Microsoft Windows users

------------------------------------------------------------
Gradle 6.4.1
------------------------------------------------------------

Build time:   2020-05-15 19:43:40 UTC
Revision:     1a04183c502614b5c80e33d603074e0b4a2777c5

Kotlin:       1.3.71
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11 (Oracle Corporation 11+28)
OS:           Windows 10 10.0 amd64

Hello World with Gradle

Created to projecto java with the next packages src/main/java/hw/Main.java

package hw;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world with Gradle");
    }
}

Build gradle

gradle build

BUILD SUCCESSFUL in 2s
2 actionable tasks: 2 executed

thank you for reading