简体   繁体   中英

Why everyone says I should include gradlew in my source control if its version is explicitly on build.gradle?

According to this and many others places/forums I have looked at, I should always include gradle wrapper files in my git/svn/cvs.

But, why? In my build.gradle file I am already including explicitly the gradle version I want my project working with. Example:

task wrapper(type: Wrapper) {
    gradleVersion = "2.12"
}

I have already made tests and always when I import/build the project without pulling the gradle wrapper files from the source control, it creates the gradlew file for me with the version from build.gradle.

Including the wrapper lets people who don't have gradle installed build your project without having to manually download or install anything. This is very helpful for people who are going to build on the command line.

Running ./gradlew installDist is usually easier than having to install gradle in order to bootstrap the correct version.

You'll want to include the following files:

gradlew
gradlew.bat (if you support windows)
gradle
└── wrapper
    ├── gradle-wrapper.jar
    └── gradle-wrapper.properties

and ignore .gradle/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM