Why should the Gradle Wrapper be committed to VCS?

后端 未结 6 1825
甜味超标
甜味超标 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:12

    I would like to recommend a simple approach.

    In your project's README, document that an installation step is required, namely:

    gradle wrapper --gradle-version 3.3
    

    This works with Gradle 2.4 or higher. This creates a wrapper without requiring a dedicated task to be added to "build.gradle".

    With this option, ignore (do not check in) these files/folders for version control:

    • ./gradle
    • gradlew
    • gradlew.bat

    The key benefit is that you don't have to check-in a downloaded file to source control. It costs one extra step on installation. I think it is worth it.

提交回复
热议问题