Compare commits

2 Commits

Author SHA1 Message Date
LittleTurtle2333
4f20d364c6 修改生成的apk名字 2023-02-24 18:08:29 +08:00
LittleTurtle2333
62f08e5bcf 更新 .gitignore 2023-02-24 18:07:45 +08:00
2 changed files with 20 additions and 4 deletions

3
.gitignore vendored
View File

@@ -15,5 +15,4 @@
.externalNativeBuild .externalNativeBuild
.cxx .cxx
local.properties local.properties
/app/release/app-release.apk /app/release/*
/app/release/output-metadata.json

View File

@@ -14,8 +14,6 @@ android {
versionCode 75 versionCode 75
versionName '1.7.5-Yuki' versionName '1.7.5-Yuki'
buildConfigField("String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"") buildConfigField("String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
@@ -44,6 +42,25 @@ android {
lintOptions { lintOptions {
checkReleaseBuilds false checkReleaseBuilds false
} }
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
// 名称+当前版本号
def fileName = "WooBoxForMIUI_v${defaultConfig.versionName}"
// 加入打包日期
def releaseDate = new Date().format("MMddHHmmss", TimeZone.getDefault())
fileName = fileName + "_${releaseDate}"
// 如果是debug版本加入debug
if ( variant.buildType.name =='debug') {
fileName = fileName + "_debug"
}else if(variant.buildType.name =='release') {
fileName = fileName + "_release"
}
// 最终生成文件名
output.outputFileName = fileName + ".apk"
}
}
} }
dependencies { dependencies {