|
|
@ -20,6 +20,7 @@ apply plugin: 'com.android.application' |
|
|
|
apply plugin: 'org.greenrobot.greendao' |
|
|
|
apply plugin: 'org.greenrobot.greendao' |
|
|
|
apply plugin: 'kotlin-android' |
|
|
|
apply plugin: 'kotlin-android' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.android.build.OutputFile |
|
|
|
def releaseTime() { |
|
|
|
def releaseTime() { |
|
|
|
return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+08:00")) |
|
|
|
return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+08:00")) |
|
|
|
} |
|
|
|
} |
|
|
@ -46,7 +47,8 @@ def getVersionC() { |
|
|
|
|
|
|
|
|
|
|
|
def name = "风月读书" |
|
|
|
def name = "风月读书" |
|
|
|
def versionC = getVersionC() |
|
|
|
def versionC = getVersionC() |
|
|
|
def versionN = versionC.toString().join("", ".") |
|
|
|
def versionN = versionC.toString() |
|
|
|
|
|
|
|
versionN = versionN[0] + "." + versionN[1] + "." + versionN[2] |
|
|
|
|
|
|
|
|
|
|
|
// 读取keystore.properties |
|
|
|
// 读取keystore.properties |
|
|
|
def keyProps = new Properties() |
|
|
|
def keyProps = new Properties() |
|
|
@ -83,6 +85,15 @@ android { |
|
|
|
viewBinding true |
|
|
|
viewBinding true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
splits { |
|
|
|
|
|
|
|
abi { |
|
|
|
|
|
|
|
reset() |
|
|
|
|
|
|
|
enable true |
|
|
|
|
|
|
|
universalApk true // If true, also generate a universal APK |
|
|
|
|
|
|
|
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
buildTypes { |
|
|
|
buildTypes { |
|
|
|
release { |
|
|
|
release { |
|
|
|
minifyEnabled false |
|
|
|
minifyEnabled false |
|
|
@ -90,9 +101,6 @@ android { |
|
|
|
if (keyPropsFile.exists()) { |
|
|
|
if (keyPropsFile.exists()) { |
|
|
|
signingConfig signingConfigs.myConifg |
|
|
|
signingConfig signingConfigs.myConifg |
|
|
|
} |
|
|
|
} |
|
|
|
ndk { |
|
|
|
|
|
|
|
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
debug { |
|
|
|
debug { |
|
|
|
minifyEnabled false |
|
|
|
minifyEnabled false |
|
|
@ -102,18 +110,19 @@ android { |
|
|
|
} |
|
|
|
} |
|
|
|
applicationIdSuffix ".debug" |
|
|
|
applicationIdSuffix ".debug" |
|
|
|
versionNameSuffix "-" + commitId |
|
|
|
versionNameSuffix "-" + commitId |
|
|
|
ndk { |
|
|
|
|
|
|
|
abiFilters "arm64-v8a" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
android.applicationVariants.all { variant -> |
|
|
|
android.applicationVariants.all { variant -> |
|
|
|
def buildType = variant.buildType.name |
|
|
|
def buildType = variant.buildType.name |
|
|
|
def fileName = "${name}v${defaultConfig.versionName}.apk" |
|
|
|
variant.outputs.each { output -> |
|
|
|
|
|
|
|
def abi = output.getFilter(OutputFile.ABI) |
|
|
|
|
|
|
|
if (abi == null) { |
|
|
|
|
|
|
|
abi = "universal" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
def fileName = "${name}v${defaultConfig.versionName}-${abi}.apk" |
|
|
|
if (buildType == "debug"){ |
|
|
|
if (buildType == "debug"){ |
|
|
|
fileName = "${name}v${defaultConfig.versionName}-${commitId}.apk" |
|
|
|
fileName = "${name}v${defaultConfig.versionName}-${abi}-${commitId}.apk" |
|
|
|
} |
|
|
|
} |
|
|
|
variant.outputs.all { |
|
|
|
output.outputFileName = fileName |
|
|
|
outputFileName = fileName |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|