0% found this document useful (0 votes)
23 views16 pages

Gradle Core Concepts

Gradle is a build automation tool that organizes projects into single or multi-project builds, utilizing build scripts to define the build process. It manages external dependencies and executes tasks, which are units of work, often enhanced by plugins. The Gradle Wrapper is recommended for executing builds to ensure consistency across different environments.

Uploaded by

JAVIER MURCIA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views16 pages

Gradle Core Concepts

Gradle is a build automation tool that organizes projects into single or multi-project builds, utilizing build scripts to define the build process. It manages external dependencies and executes tasks, which are units of work, often enhanced by plugins. The Gradle Wrapper is recommended for executing builds to ensure consistency across different environments.

Uploaded by

JAVIER MURCIA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Gradle core concepts

Projects
A Gradle project is a piece of software that can be built, such as an application or a library.
Single project builds include a single project called the root project.
Multi-project builds include one root project and any number of subprojects.
Build Scripts
Build scripts detail to Gradle what steps to take to build the project.
Each project can include one or more build scripts.
Dependency Management
Dependency management is an automated technique for declaring and resolving external resources required by a project.
Each project typically includes a number of external dependencies that Gradle will resolve during the build.
Tasks
Tasks are a basic unit of work such as compiling code or running your test.
Each project contains one or more tasks defined inside a build script or a plugin.
Plugins
Plugins are used to extend Gradle’s capability and optionally contribute tasks to a project.
Command line

Gradle can be invoked in the command line once installed. For example:

$ gradle build

Gradle Wrapper

The Wrapper is a script that invokes a declared version of Gradle and is the recommended way to execute a Gradle build. It
is found in the project root directory as a gradlew or gradlew.bat file:

$ gradlew build // Linux or OSX

$ gradlew.bat build // Windows


Using the Gradle Wrapper

It is always recommended to execute a build with the Wrapper to ensure a reliable, controlled, and standardized execution
of the build.

Depending on the operating system, you run gradlew or gradlew.bat instead of the gradle command.

Typical Gradle invocation:

$ gradle build

To run the Wrapper on a Linux or OSX machine:

$ ./gradlew build

To run the Wrapper on Windows PowerShell:

$ .\gradlew.bat build
-
gradle init --dsl groovy --type groovy-gradle-plugin --project-name license --no-build-cache --stacktrace

You might also like