Learn Gradle | tutorials, and examples
What is Gradle?
Gradle is an Opensource build automation tool to build and run projects in Android and java based on projects.
Features:
- Incremental builds Gradle considers the last modified files and the last build and only builds with modified files thus improving performance.
- Parallel task execution
- Build caching
- JVM and Android application management
Gradle version
The current version is 7.1.
Gradle Download
The Gradle tool can be downloaded from here🔗. You can check my other post below to check whether Gradle is installed or not.
The Gradle download can be in a binary form or a complete form.
gradle vs maven
There are a lot of differences between Gradle and Maven.
You can check another article difference between Gradle and maven
gradle plugins
Gradle plugins are useful to add extra functionality for tasks, dependency, and configuration values.
Frequently used plugins
- java plugin
- maven-plugin
- android plugin
What is the Gradle wrapper
The Gradle wrapper is a command-line tool to start the Gradle build project.
It contains two batch script files in Gradle-based projects.
- gradlew.bat for windows
- gradlew.sh for Linux system
The gradle wrapper allows you to run and build projects without installing them on the local machine.
These gradle wrapper scripts add by default with the Gradle project.
You can still add using the below command.
gradle wrapper --gradle-version 7.1.1
It adds the following files to the project.
└── <project folder>
└── gradlew
└── gradlew.bat
└── build.gradle
└──
└──
└── gradle
└── wrapper
└── gradle-wrapper.jar
└── gradle-wrapper.properties
You can also check a difference between Gradle and gradlew command
Gradle Cheatsheet
Parameter | Description |
---|---|
gradle installs and configure | How to install Gradle on Windows, Linux, and Mac OS, configure environment variables to setup |
gitignore Gradle project | How to add gitignore to gradle projects for android and java projects |
Gradle command list | It includes frequently used command build and running java projects |
gradle dependency tree | In this tutorial, Different ways to get dependency graph for single and multi-modular Gradle projects |
Gradle exclude dependencies | How to exclude dependencies globally as well as per transitive dependencies |
gradle force redownload dependency | In this tutorial, Learned multiple ways how to remove and update dependencies |
gradle ignore test case execution | In this post, You learned different ways to exclude running test cases with all as well as single test cases |
Configure JDK version in gradle | How to configure javac source and target java JDK versions in gradle build |
Running single test cases | Different ways to compile and execute single test cases |
Difference between gradle and gradlew | Explain the main difference between gradle and Gradle wrapper commands |
Difference between gradle and maven | Explain the main difference between gradle and maven builds |
Permission Denied error in gradle | How to fix permission denied error in Gradle running in Linux and unix |
release API in android | In this tutorial, posted about generating a release signed and unsigned APK file in android apps using Gradle build |
gitignore-gradle-project | In this Section, discussed what not to commit in an android application for a gitignore file during commit to repository |