在 signingConfigs
release
节点下配置
//打包名设置
applicationVariants.all{variant->
variant.outputs.each{output->
if(variant.buildType.name.equals('release')) {
def fileName = "xbzd_v${variant.versionName}"+"_${variant.flavorName}"+"_"+releaseTime();
def outputFile = output.outputFile
output.packageApplication.outputFile = new File(outputFile.parent, fileName)
}
}
}
最终生成的akp名:xbzd_v1.1.0_anzhi_20180716
releaseTime的配置
def releaseTime() {
return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
}