You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
4.4 KiB
121 lines
4.4 KiB
apply plugin: 'com.android.application' |
|
apply from : '../common.gradle' |
|
|
|
android { |
|
defaultConfig { |
|
// 应用商店唯一标识ID |
|
// https://developer.android.com/studio/build/application-id?hl=zh-cn |
|
applicationId 'com.kanglai.push' |
|
|
|
// 仅保留 xxhdpi 图片资源(目前主流分辨率 1920 * 1080) |
|
resConfigs 'xxhdpi' |
|
|
|
// 混淆配置 |
|
proguardFiles 'proguard-app.pro' |
|
} |
|
|
|
// 签名参考: https://www.jianshu.com/p/a1f8e5896aa2 |
|
signingConfigs { |
|
config { |
|
storeFile file('app.jks') |
|
storePassword '123456' |
|
keyAlias 'dolphin' |
|
keyPassword '123456' |
|
// https://source.android.com/docs/security/features/apksigning?hl=zh-cn |
|
v1SigningEnabled true |
|
v2SigningEnabled true |
|
} |
|
} |
|
|
|
// 构建配置:https://developer.android.google.cn/studio/build/build-variants |
|
buildTypes { |
|
debug { |
|
// 调试模式开关 |
|
debuggable true |
|
jniDebuggable true |
|
// 压缩对齐开关 |
|
zipAlignEnabled false |
|
// 移除无用的资源 |
|
shrinkResources false |
|
// 代码混淆开关 |
|
minifyEnabled false |
|
// 签名信息配置 |
|
signingConfig signingConfigs.config |
|
// 添加清单占位符 |
|
addManifestPlaceholders([ |
|
'app_name': '@string/app_name' |
|
]) |
|
// 调试模式下只保留一种主流cpu架构so库,提升打包速度 |
|
ndk { |
|
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86","x86_64" |
|
} |
|
} |
|
|
|
release { |
|
// 调试模式开关 |
|
debuggable true |
|
// 可连接进行设备调试 |
|
jniDebuggable true |
|
// 压缩对齐优化开关 |
|
zipAlignEnabled true |
|
// 移除无用的资源 |
|
shrinkResources true |
|
// 代码混淆开关 |
|
minifyEnabled true |
|
// 签名信息配置 |
|
signingConfig signingConfigs.config |
|
// 添加清单占位符 |
|
addManifestPlaceholders([ |
|
'app_name': '@string/app_name' |
|
]) |
|
// 仅保留两种架构的 so 库,根据 Bugly 统计得出 |
|
ndk { |
|
// armeabi:万金油架构平台(占用率:0%) |
|
// armeabi-v7a:曾经主流的架构平台(占用率:10%) |
|
// arm64-v8a:目前主流架构平台(占用率:95%) |
|
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86","x86_64" |
|
} |
|
} |
|
} |
|
|
|
packagingOptions { |
|
// 剔除这个包下的所有文件(不会移除签名信息) |
|
exclude 'META-INF/*******' |
|
} |
|
|
|
// 应用程序变量配置 |
|
applicationVariants.all { variant -> |
|
// apk 输出文件名配置 |
|
variant.outputs.all { output -> |
|
outputFileName = rootProject.getName() + '_v' + variant.versionName + '_' + variant.buildType.name |
|
if (variant.buildType.name == buildTypes.release.getName()) { |
|
outputFileName += '_' + new Date().format('MMdd') |
|
} |
|
outputFileName += '.apk' |
|
} |
|
} |
|
} |
|
|
|
// 添加构建依赖项:https://developer.android.google.cn/studio/build/dependencies |
|
// api 与 implementation 的区别:https://www.jianshu.com/p/8962d6ba936e |
|
dependencies { |
|
// 友盟封装库 |
|
implementation project(':library:umeng') |
|
implementation files('libs/AMap_Location_V6.4.2_20231215.jar') // 高德定位sdk |
|
implementation DEPENDENCIES['pager-bottom-tab-strip'] |
|
implementation DEPENDENCIES['pictureselector'] |
|
implementation DEPENDENCIES['pictureselector-compress'] |
|
implementation DEPENDENCIES['pictureselector-ucrop'] |
|
implementation DEPENDENCIES['pictureselector-camerax'] |
|
implementation DEPENDENCIES['advanced-recyclerview'] |
|
implementation DEPENDENCIES['exoplayer'] |
|
implementation DEPENDENCIES['refresh-header-classics'] |
|
implementation DEPENDENCIES['refresh-footer-classics'] |
|
implementation DEPENDENCIES['loadinglayout'] |
|
|
|
// 业务模块新依赖 2023年4月28日 |
|
implementation DEPENDENCIES['indexable-recycler-view-x'] |
|
implementation DEPENDENCIES['x-banner'] |
|
implementation DEPENDENCIES['switch-button'] |
|
implementation DEPENDENCIES['aurora-imui'] |
|
}
|
|
|