Why should the Gradle Wrapper be committed to VCS?

后端 未结 6 1822
甜味超标
甜味超标 2021-01-29 23:49

From Gradle\'s documentation: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.wrapper.Wrapper.html

The scripts generated by this

6条回答
  •  执笔经年
    2021-01-30 00:35

    Because the whole point of the gradle wrapper is to be able, without having ever installed gradle, and without even knowing how it works, where to download it from, which version, to clone the project from the VCS, to execute the gradlew script it contains, and to build the project without any additional step.

    If all you had was a gradle version number in a build.gradle file, you would need a README explaining everyone that gradle version X must be downloaded from URL Y and installed, and you would have to do it every time the version is incremented.

提交回复
热议问题