Should I .gitignore my gradlew?
Asked Answered
L

3

48

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?

Leola answered 13/5, 2017 at 15:37 Comment(0)
N
50

NOT Really. Reason being if someone download or clone your repo and try to run your application through command line and they do not have gradle installed on their local machine, they have 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.

Nitroparaffin answered 13/5, 2017 at 15:52 Comment(0)
C
24

Per doc

The Wrapper is something you should check into version control. By distributing the Wrapper with your project, anyone can work with it without needing to install Gradle beforehand.

Commissariat answered 13/5, 2017 at 15:52 Comment(0)
H
0

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.

Horoscopy answered 9/3, 2022 at 11:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.