使用 可以直接 = ,或者用 ${getVerName()}
编译后输出路径:
这有很多中做法,一种是build后拷贝,一种是直接修改variants的输出路径,这里暂时先提供后面一种:
buildTypes {
release {
// .....
applicationVariants.all { variant ->
if ("release".equals(variant.buildType.name)) {// Only Release
variant.outputs.each { output ->
def targetDir = "D:/App"; // 目标路径
output.outputFile = new File(targetDir,
"App_${getVerName()}_${getSvnRevision()}.apk");
println(output.outputFile)
}
}
}
}
}










