我的 gradle 项目在存储库中包含 gradlew 和 gradlew.bat 文件,是否应该将它们推送到 git?我没看到有人说应该删除它们 here .这些文件的用途是什么?
最佳答案
不是真的。原因是如果有人下载或克隆你的 repo 并尝试通过命令行运行你的应用程序,而他/她没有在他/她的本地机器上安装 gradle,他/她必须安装和配置 Gradle 然后运行它。 gradlew 提供了一种通过安装运行 gradle 构建的便捷方式。
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.
关于git - 我应该 .gitignore 我的 gradlew 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43954932/