git - 我应该 .gitignore 我的 gradlew 吗?

标签 git github gradle gradlew

我的 gradle 项目在存储库中包含 gradlew 和 gradlew.bat 文件,是否应该将它们推送到 git?我没看到有人说应该删除它们 here .这些文件的用途是什么?

最佳答案

不是真的。原因是如果有人下载或克隆你的 repo 并尝试通过命令行运行你的应用程序,而他/她没有在他/她的本地机器上安装 gradle,他/她必须安装和配置 Gradle 然后运行它。 gradlew 提供了一种通过安装运行 gradle 构建的便捷方式。

这是Gradle documentation说:

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/

相关文章:

Git 在接收对象时卡住了

git - Git 中的报告生成

git - 将部署(只读)github key 存储在私有(private)仓库中是否安全

linux - Heroku + git = ENOENT : spawn git ENOENT

git - 如何列出所有更改文件数的 pull 请求

github - 如何在公共(public) github 存储库上创建后服务 Hook ?

在 Cygwin 中通过 SSH 进行 Git 克隆不提示输入密码,而是输出错误

java - Gradle同步问题: CreateProcess error=2

gradle - 在没有提供版本的情况下,一些 gradle 依赖项如何工作

plugins - 编写Gradle插件时如何编写适当的警告消息?