[英]Is there a way to tell android to always take the latest gradle plugin?
In my gradle.build
, generated for me by Eclipse, I had 在我的Eclipse为我生成的gradle.build
,我有
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
Now there was a serious issue with the 0.4
version ( https://groups.google.com/forum/#!msg/adt-dev/_pB-fsNZapM/Ogcamgw-X9wJ ) so I had to change gradle.build
to use 0.4.2
where it has been fixed: 现在0.4
版本存在严重问题( https://groups.google.com/forum/#!msg/adt-dev/_pB-fsNZapM/Ogcamgw-X9wJ ),所以我不得不将gradle.build
更改为使用0.4.2
已修复的位置:
dependencies {
classpath 'com.android.tools.build:gradle:0.4.2'
}
Is there a way, though, to tell in the gradle.build
to always pick up the latest possible android gradle plugin version? 但是,有没有办法告诉gradle.build
始终选择最新的Android gradle插件版本?
I think that you can use ranges as it is supported by modern ivy versions . 我认为您可以使用现代常春藤版本支持的范围。
Using latest.release instead of a fixed version should do in your case. 在这种情况下,应该使用latest.release而不是固定版本。
Instead of a version number you can supply a +. 除了版本号,您还可以提供+。 It works as a wildcard. 它用作通配符。
classpath 'com.android.tools.build:gradle:0.4.+' classpath'com.android.tools.build:gradle:0.4.+'
will take the latest until 0.5.0 comes out. 直到0.5.0出来。
classpath 'com.android.tools.build:gradle:0.+' classpath'com.android.tools.build:gradle:0.+'
will take the latest until 1.0.0 comes out. 将采用最新版本,直到1.0.0发布。
classpath 'com.android.tools.build:gradle:+' classpath'com.android.tools.build:gradle:+'
will always take the latest. 将始终采用最新版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.