|
|
@ -2,6 +2,11 @@ plugins { |
|
|
|
id 'com.android.application' |
|
|
|
id 'com.android.application' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def static releaseTime() { |
|
|
|
|
|
|
|
return new Date().format("yyyyMMdd_HHmmss", TimeZone.default) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
android { |
|
|
|
android { |
|
|
|
namespace 'cc.niushuai.dididone' |
|
|
|
namespace 'cc.niushuai.dididone' |
|
|
|
compileSdk 34 |
|
|
|
compileSdk 34 |
|
|
@ -10,9 +15,11 @@ android { |
|
|
|
applicationId "cc.niushuai.dididone" |
|
|
|
applicationId "cc.niushuai.dididone" |
|
|
|
minSdk 24 |
|
|
|
minSdk 24 |
|
|
|
targetSdk 32 |
|
|
|
targetSdk 32 |
|
|
|
versionCode 1 |
|
|
|
versionCode 12 |
|
|
|
versionName "1.2" |
|
|
|
versionName "1.2" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resValue "string", "weathericons_version", "${versionName}" |
|
|
|
|
|
|
|
|
|
|
|
javaCompileOptions { |
|
|
|
javaCompileOptions { |
|
|
|
annotationProcessorOptions { |
|
|
|
annotationProcessorOptions { |
|
|
|
arguments += [ |
|
|
|
arguments += [ |
|
|
@ -38,6 +45,19 @@ android { |
|
|
|
buildFeatures { |
|
|
|
buildFeatures { |
|
|
|
viewBinding true |
|
|
|
viewBinding true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
android.applicationVariants.all { |
|
|
|
|
|
|
|
variant -> |
|
|
|
|
|
|
|
variant.outputs.all { |
|
|
|
|
|
|
|
//这里修改apk文件名 |
|
|
|
|
|
|
|
outputFileName = "${getAppName()}_v${variant.versionName.replaceAll('\\s+', '_')}_${releaseTime()}_${variant.buildType.name}.apk" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getAppName() { |
|
|
|
|
|
|
|
def stringsFile = android.sourceSets.main.res.sourceFiles.find { it.name.equals 'strings.xml' } |
|
|
|
|
|
|
|
return new XmlParser().parse(stringsFile).string.find { it.@name.equals 'app_name' }.text() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dependencies { |
|
|
|
dependencies { |
|
|
|