优化编译脚本

serial
BlueMatthew 1 year ago
parent f57d87a026
commit 666ccfdc93

@ -42,29 +42,10 @@ android {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
if (outputFileName.endsWith('.apk')) {
def fileName = "mpapp_v${defaultConfig.versionName}_rel_${new Date(System.currentTimeMillis()).format("yyyyMMdd")}.apk"
outputFileName = fileName
}
}
}
} }
debug { debug {
jniDebuggable true jniDebuggable true
testCoverageEnabled false testCoverageEnabled false
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
if (outputFileName.endsWith('.apk')) {
def fileName = "mpapp_v${defaultConfig.versionName}_${new Date(System.currentTimeMillis()).format("yyyyMMdd")}.apk"
outputFileName = fileName
}
}
}
} }
} }
@ -84,6 +65,20 @@ android {
version '3.22.1' version '3.22.1'
} }
} }
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
if (outputFileName.endsWith('.apk')) {
def buildTypeFlag = "dbg"
if(variant.buildType.name.equals('release')) {
buildTypeFlag = "rel"
}
def fileName = "mpapp_v${defaultConfig.versionName}_${buildTypeFlag}_${new Date(System.currentTimeMillis()).format("yyyyMMdd")}.apk"
outputFileName = fileName
}
}
}
buildFeatures { buildFeatures {
viewBinding true viewBinding true
} }

@ -28,25 +28,21 @@ android {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
if (outputFileName.endsWith('.apk')) {
def fileName = "MpMaster_v${defaultConfig.versionName}_rel_${new Date(System.currentTimeMillis()).format("yyyyMMdd")}.apk"
outputFileName = fileName
}
}
}
} }
debug { debug {
jniDebuggable true jniDebuggable true
}
}
android.applicationVariants.all { variant -> android.applicationVariants.all { variant ->
variant.outputs.all { output -> variant.outputs.all { output ->
if (outputFileName.endsWith('.apk')) { if (outputFileName.endsWith('.apk')) {
def fileName = "MpMaster_v${defaultConfig.versionName}_${new Date(System.currentTimeMillis()).format("yyyyMMdd")}.apk" def buildTypeFlag = "dbg"
outputFileName = fileName if(variant.buildType.name.equals('release')) {
} buildTypeFlag = "rel"
} }
def fileName = "MpMaster_v${defaultConfig.versionName}_${buildTypeFlag}_${new Date(System.currentTimeMillis()).format("yyyyMMdd")}.apk"
outputFileName = fileName
} }
} }
} }

Loading…
Cancel
Save