Using the Gradle wrapper
Normally, if we want to run a Gradle build, we must have Gradle installed on our computer. Also, if we distribute our project to others and they want to build the project, they must have Gradle installed on their computers. The Gradle wrapper can be used to allow others to build our project even if they don't have Gradle installed on their computers.
The wrapper is a batch script on the Microsoft Windows operating systems or shell script on other operating systems that will download Gradle and run the build using the downloaded Gradle.
By using the wrapper, we can make sure the correct Gradle version for the project is used. We can define the Gradle version, and if we run the build via the wrapper script file, the version of Gradle that we defined is used.
Creating wrapper scripts
To create the Gradle wrapper batch and shell script, we must add a task to our build. The type of task is org.gradle.api.tasks.wrapper.Wrapper
. We set the gradleVersion
property to the Gradle...