My gradle project includes gradlew and gradlew.bat files inside of the repository, should they be pushed to git or not? I did not see anybody say they should be removed here. What is the purpose of these files?
3 Answers
NOT Really. Reason being if someone download or clone your repo and try to run your application through command line and he/she does not have gradle installed on his/her local machine, he/she has to install and configure Gradle and then run it. The gradlew provides a convenient way to run a gradle build with installing it.
Here is what Gradle documentation says:
Most tools require installation on your computer before you can use them. If the installation is easy, you may think that’s fine. But it can be an unnecessary burden on the users of the build. Equally importantly, will the user install the right version of the tool for the build? What if they’re building an old version of the software?
The Gradle Wrapper (henceforth referred to as the “Wrapper”) solves both these problems and is the preferred way of starting a Gradle build.

- 1
- 1

- 506
- 6
- 9
The wrapper guarantees you’ll be using the version of Gradle required by the project. you can easily update the project to a newer version of Gradle, and push those changes to version control so other team members use the newer version.

- 2,037
- 9
- 42
- 54