73

When working on a team of android developers using gradle as your build system. Should you include gradle/wrapper/gradle-wrapper.properties in git, or should it be part of your .gitignore?

Reid Baker
  • 1,259
  • 1
  • 12
  • 14
  • Possible duplicate of [Why should the Gradle Wrapper be committed to VCS?](https://stackoverflow.com/questions/20348451/why-should-the-gradle-wrapper-be-committed-to-vcs) – Franklin Yu Nov 27 '17 at 06:10

2 Answers2

92

It should be included in your git repo.

By using it with gradlew, this will ensure all your developers (and your build servers!) always use the same version of Gradle. This way you know that every one is building the same exact way.

Xavier Ducrohet
  • 28,383
  • 5
  • 88
  • 64
  • 1
    did Android Studio behavior recently change (0.4.4?) with regards to automatically updating gradle-wrapper.properties? Recently I've been getting prompted to commit changes in the file, which appear to be in the commented out timestamp at the top - see http://goo.gl/sA9hh4 for example. Don't recall this behavior previously. – Sean Barbeau Feb 13 '14 at 21:14
  • @SeanBarbeau I'm not sure TBH. the fact that the version of Gradle is the same is strange. Shouldn't have changed this. – Xavier Ducrohet Feb 13 '14 at 21:58
11

It should be put under source control, as it's necessary for gradlew to work properly.

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259