update
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
def appName() {
|
||||
return "应用市场"
|
||||
}
|
||||
|
||||
def releaseTime() {
|
||||
return new Date().format("yyyyMMddHHmmss", TimeZone.getDefault())
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
@@ -11,10 +19,67 @@ android {
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
//签名
|
||||
signingConfigs {
|
||||
debug {
|
||||
storeFile file("src/keys/SchoolEbaiFeng.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "key0"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
release {// 签名文件
|
||||
storeFile file("src/keys/SchoolEbaiFeng.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "key0"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
debug {
|
||||
// 显示Log
|
||||
buildConfigField "boolean", "LOG_DEBUG", "true"
|
||||
versionNameSuffix "-debug"
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
//Zipalign优化
|
||||
zipAlignEnabled true
|
||||
signingConfig signingConfigs.debug
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
if (outputFile != null) {
|
||||
def fileName = "${appName()}-V${defaultConfig.versionName}-${releaseTime()}.apk"
|
||||
output.outputFileName = fileName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
release {
|
||||
// 不显示Log
|
||||
buildConfigField "boolean", "LOG_DEBUG", "false"
|
||||
//混淆
|
||||
minifyEnabled false
|
||||
//Zipalign优化
|
||||
zipAlignEnabled true
|
||||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
//签名
|
||||
signingConfig signingConfigs.release
|
||||
// 将release版本的包名重命名,加上版本及日期
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def outputFile = ""
|
||||
if (outputFile != null) {
|
||||
def fileName = "${appName()}-${defaultConfig.versionCode}-V${defaultConfig.versionName}-${releaseTime()}.apk"
|
||||
output.outputFileName = new File(outputFile, fileName)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,9 +102,9 @@ dependencies {
|
||||
implementation 'com.arialyy.aria:core:3.7.7'
|
||||
annotationProcessor 'com.arialyy.aria:compiler:3.7.7'
|
||||
//OKGO
|
||||
implementation 'com.lzy.net:okgo:3.0.4'
|
||||
implementation 'com.lzy.net:okrx:1.0.2'
|
||||
implementation 'com.lzy.net:okserver:2.0.5'
|
||||
implementation 'com.lzy.net:okgo:2.1.4'
|
||||
implementation 'com.lzy.net:okrx:0.1.2'
|
||||
implementation 'com.lzy.net:okserver:1.1.3'
|
||||
|
||||
implementation 'com.alibaba:fastjson:1.2.21'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user