mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 01:17:41 +08:00
优化:增加ABI配置(按CPU架构分别打包)
This commit is contained in:
parent
ee740829d8
commit
02c0189d28
@ -27,6 +27,9 @@ android {
|
|||||||
versionCode versionProps['versionCode'].toInteger()
|
versionCode versionProps['versionCode'].toInteger()
|
||||||
versionName versionProps['versionName']
|
versionName versionProps['versionName']
|
||||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
|
//ndk {
|
||||||
|
// abiFilters 'armeabi-v7a', 'x86_64'
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
lintOptions {
|
lintOptions {
|
||||||
checkReleaseBuilds false
|
checkReleaseBuilds false
|
||||||
@ -47,31 +50,40 @@ android {
|
|||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
//minifyEnabled true
|
minifyEnabled false
|
||||||
//shrinkResources true
|
//shrinkResources true
|
||||||
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
//minifyEnabled true
|
minifyEnabled false
|
||||||
//shrinkResources true
|
//shrinkResources true
|
||||||
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//apk file name
|
//ABI配置——按CPU架构分别打包
|
||||||
android.applicationVariants.all { variant ->
|
splits {
|
||||||
variant.outputs.all {
|
abi {
|
||||||
//def date = new Date().format("yyyyMMdd" , TimeZone.getTimeZone("Asia/Shanghai"))
|
enable true
|
||||||
def date = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08"))
|
reset()
|
||||||
if (variant.buildType.name == 'debug') {
|
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
outputFileName = "SmsForwarder_debug_${date}_${versionName}.apk"
|
universalApk true
|
||||||
}
|
|
||||||
if (variant.buildType.name == 'release') {
|
|
||||||
outputFileName = "SmsForwarder_release_${date}_${versionName}.apk"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
def abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4, 'universal': 5]
|
||||||
|
android.applicationVariants.all { variant ->
|
||||||
|
// Assigns a different version code for each output APK.
|
||||||
|
variant.outputs.each {
|
||||||
|
output ->
|
||||||
|
def date = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08"))
|
||||||
|
def abiName = output.getFilter(com.android.build.OutputFile.ABI)
|
||||||
|
if (abiName == null) abiName = "universal"
|
||||||
|
output.versionCodeOverride = abiCodes.get(abiName, 0) * 10000 + variant.versionCode
|
||||||
|
output.outputFileName = "SmsForwarder_${variant.name}_${versionName}_${output.versionCodeOverride}_${date}_${abiName}.apk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
exclude 'META-INF/DEPENDENCIES.txt'
|
exclude 'META-INF/DEPENDENCIES.txt'
|
||||||
exclude 'META-INF/LICENSE.txt'
|
exclude 'META-INF/LICENSE.txt'
|
||||||
@ -151,7 +163,7 @@ dependencies {
|
|||||||
//友盟统计SDK
|
//友盟统计SDK
|
||||||
implementation 'com.umeng.umsdk:common:9.4.6'// 必选
|
implementation 'com.umeng.umsdk:common:9.4.6'// 必选
|
||||||
implementation 'com.umeng.umsdk:asms:1.6.0'// asms包依赖必选
|
implementation 'com.umeng.umsdk:asms:1.6.0'// asms包依赖必选
|
||||||
//implementation 'com.umeng.umsdk:apm:1.5.2'// 错误分析升级为独立SDK,看crash数据请一定集成,可选
|
implementation 'com.umeng.umsdk:apm:1.5.2'// 错误分析升级为独立SDK,看crash数据请一定集成,可选
|
||||||
//implementation 'com.umeng.umsdk:abtest:1.0.0'//使用U-App中ABTest能力,可选
|
//implementation 'com.umeng.umsdk:abtest:1.0.0'//使用U-App中ABTest能力,可选
|
||||||
|
|
||||||
//XUpdate
|
//XUpdate
|
||||||
@ -173,8 +185,10 @@ dependencies {
|
|||||||
//AndroidAsync
|
//AndroidAsync
|
||||||
implementation 'com.koushikdutta.async:androidasync:3.1.0'
|
implementation 'com.koushikdutta.async:androidasync:3.1.0'
|
||||||
|
|
||||||
|
//吐司框架:https://github.com/getActivity/ToastUtils
|
||||||
|
implementation 'com.github.getActivity:ToastUtils:10.3'
|
||||||
//权限请求框架:https://github.com/getActivity/XXPermissions
|
//权限请求框架:https://github.com/getActivity/XXPermissions
|
||||||
//implementation 'com.github.getActivity:XXPermissions:13.2'
|
implementation 'com.github.getActivity:XXPermissions:13.2'
|
||||||
|
|
||||||
//jetty
|
//jetty
|
||||||
implementation "org.eclipse.jetty:jetty-server:9.2.30.v20200428"
|
implementation "org.eclipse.jetty:jetty-server:9.2.30.v20200428"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user