The difference between using gradle w and gradle

What is the difference between using gradlew and gradle or are they the same?

+189
gradle gradlew
Sep 21 '16 at 21:59
source share
2 answers

The difference is that ./gradlew indicates that you are using a gradle wrapper. The wrapper is usually part of the project and makes gradle installation easier. If you used gradle without a shell, you have to manually install it - for example, on mac brew install gradle , and then call gradle with the gradle . In both cases, you use gradle, but the first is more convenient and ensures version consistency on different machines.

Each Wrapper is tied to a specific version of gradle, so when you first run one of the above commands for a given version of gradle, it will download the appropriate gradle distribution and use it to build.

This not only means that you donโ€™t have to manually install Gradle, but you are also sure to use the version of gradle that the assembly is intended for. This makes your historical building more reliable.

More details here - https://docs.gradle.org/current/userguide/gradle_wrapper.html

In addition, Udacity has a clear high-level video explaining the concept of gradle wrapper - https://www.youtube.com/watch?v=1aA949H-shk

+188
Sep 21 '16 at
source share

gradlew is a shell that uses gradle .

Under the hood, a Gradle Wrapper ( gradlew ) does three things:

  1. Parse the arguments passed to gradlew
  2. Install the correct version of gradle
  3. Call gradle to run the specified tasks

Using Gradle Wrapper, you do not need to manage Gradle project distributions yourself. This means that every developer in your project uses the same version of Gradle and can run the Gradle build (even if Gradle has not been installed)

More here

+34
Mar 02 '18 at 20:24
source share



All Articles