Android的工作室:"使用默认的摇篮包装"与"使用定制的摇篮包装" [英] Android Studio: "Use default gradle wrapper" vs. "Use customizable gradle wrapper"
问题描述
到底什么是机器人工作室的摇篮选项之间的区别:
What exactly is the difference between Android Studio's Gradle options:
Android的工作室 - > preferences->摇篮
使用默认的摇篮包装(推荐)
和使用自定义的摇篮包装
?
背景:
我的工作在Android的Studio中的Android项目,并用摇篮的包装。
I am working on an Android project in Android Studio and using a Gradle wrapper.
然而,当我使用Android工作室设置使用自定义的gradlew包装每次我的团队成员同步使用GUI命令在Android Studio项目:
However, when I use the Android Studio settings "Use customizable gradlew wrapper" every time my team members sync the Android Studio project using the gui command:
他们发现了摇篮/封装/ gradle-wrapper.properties
日期被更新(并导致对git仓库一个额外的差别)。
they find the gradle/wrapper/gradle-wrapper.properties
date being updated (and resulting in a extra diffs on the git repo).
切换到使用默认的摇篮包装似乎解决了这个问题。
Switching to "Use default gradle wrapper" seems to solve this issue.
推荐答案
见IntelliJ IDEA的帮助的此处:
See the IntelliJ IDEA help here:
- 使用默认的摇篮包装意味着摇篮控制的版本号
- 使用定制的摇篮包装意味着IDEA控制的版本号
在摇篮包装的。该版本号存储在摇篮/封装/ gradle-wrapper.properties
。所以,你与IDEA开盘项目每一次,它会改变属性文件来调整你的想法项目中指定的包装版本。
of the gradle wrapper. The version number is stored in gradle/wrapper/gradle-wrapper.properties
. So each time you are opening the project with IDEA, it will change the property file to adjust the wrapper version you specified in the IDEA project.
为了便于重复建立让摇篮控制的版本号,并使用默认的摇篮包装(甚至你的持续构建服务器,它不运行IDEA的)。
For the sake of repeatable builds (even on your continuous build server which doesn't run IDEA) let Gradle control the version number and use the default gradle wrapper.
您可以在里面设置你的 build.gradle
与
You can set it inside your build.gradle
with
// needs at least Gradle V1.7
wrapper {
gradleVersion = '2.2.1'
}
或
// works with every Gradle version
task wrapper(type: Wrapper) {
gradleVersion = '2.2.1'
}
注:的不要忘记,这个配置只用于包装的产生。要激活它,你必须用 gradlew包装
执行生成。一旦生成了包装,它是用来 - 无论是在 build.gradle
指定
Remark: don't forget that this configuration is only for the generation of the wrapper. To activate it, you have to execute the generation with gradlew wrapper
. Once the wrapper is generated, it is used - whatever is specified in build.gradle
.
这篇关于Android的工作室:"使用默认的摇篮包装"与"使用定制的摇篮包装"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!