Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I .gitignore my gradlew?

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?

like image 232
Clay Avatar asked May 13 '17 15:05

Clay


People also ask

Should I commit Gradlew file?

From Gradle's documentation:The scripts generated by this task are intended to be committed to your version control system. This task also generates a small gradle-wrapper. jar bootstrap JAR file and properties file which should also be committed to your VCS.

Should Gradle files be in Gitignore?

Gradle compiles java files and generates class files in the target folder.so These files add to gitignore. The archive files created by the final application are in the jar, ear, and war formats.

Is Gradlew required?

No need to install gradle locally The gradlew script doesn't rely on a local Gradle installation. It goes and fetches a Gradle installation from the internet the first time it runs on your local machine, and caches it. This makes it super-easy for anybody anywhere to clone a project and build it.

What is the use of Gradlew file?

You can execute all the build tasks available to your Android project using the Gradle wrapper command line tool. It's available as a batch file for Windows ( gradlew. bat ) and a shell script for Linux and Mac ( gradlew.sh ), and it's accessible from the root of each project you create with Android Studio.


2 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.

like image 64
Imteyaz Ahmad Avatar answered Sep 29 '22 15:09

Imteyaz Ahmad


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.

like image 33
Ivo Avatar answered Sep 29 '22 16:09

Ivo