Commit a38a379e authored by jianglx's avatar jianglx

添加打包时自动命名APK的功能

parent 3c34e55c
...@@ -50,8 +50,23 @@ android { ...@@ -50,8 +50,23 @@ android {
debuggable true debuggable true
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
} }
android.applicationVariants.all { variant ->
variant.outputs.all {
//MedicalClient_{time}_v1.0.1_{build号}.apk
if (variant.buildType.name == 'release') {
def productVersion = "RV" + releaseTime() + "V" + defaultConfig.versionName + "Release" + ".apk";
outputFileName = productVersion
}
}
}
} }
} }
//打包的时间
static def releaseTime() {
return new Date().format("yyyyMMddHHss", TimeZone.getTimeZone("GMT+8"))
}
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment