Files
peko-android/app/build.gradle
2023-12-07 16:02:43 +08:00

322 lines
11 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'kotlin-android'
apply plugin: 'com.tencent.vasdolly'
apply from: '../mob.gradle'
def onlyArm64 = Boolean.parseBoolean(only_arm64)
android {
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
defaultConfig {
applicationId "com.vele.pekolive"
minSdkVersion MIN_SDK_VERSION.toInteger()
targetSdkVersion TARGET_SDK_VERSION.toInteger()
versionCode Integer.valueOf(version_code)
versionName version_name
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
flavorDimensions 'default'
manifestPlaceholders = [CRASHLYTICS_COLLECTION_ENABLED: CRASHLYTICS_COLLECTION_ENABLED.toBoolean()]
}
splits {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
universalApk true
}
}
bundle {
language {
enableSplit = false
}
density {
enableSplit = true
}
abi {
enableSplit = true
}
}
//在apk文件后边生成版本号信息
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08"))
def outputFile = output.outputFile
if (outputFile == null || !outputFile.name.endsWith('.apk')) {
return
}
def abi = output.getFilter(com.android.build.OutputFile.ABI)
if (abi == null) {
abi = "universal"
}
outputFileName = "piko_${buildType.name}_v${defaultConfig.versionName}_${abi}_${date}.apk"
}
}
lint {
abortOnError false
disable 'MissingTranslation', 'ExtraTranslation', 'ContentDescription', 'SmallSp'
}
dataBinding {
enabled = true
}
viewBinding {
enabled = true
}
signingConfigs {
v2 {
storeFile file('../pekolive.jks')
storePassword "peko2023"
keyAlias "pekolive"
keyPassword "peko2023"
v2SigningEnabled true
v1SigningEnabled true
}
v1 {
storeFile file('../pekolive.jks')
storePassword "peko2023"
keyAlias "pekolive"
keyPassword "peko2023"
v2SigningEnabled false
v1SigningEnabled true
}
}
sourceSets {
main {
java.srcDirs = [
'src/main/java',
'src/module_public_chat_hall/java',
'src/module_upgrade_app/java',
'src/module_mentoring_relationship/java',
'src/module_labour_union/java',
'src/module_room_chat/java',
'src/model_customer_server/java',
'src/module_music/java',
'src/module_mini_world/java',
'src/module_lottery_dialog/java',
'src/module_bank_card/java',
'src/module_super_admin/java',
'src/module_treasure_box/java',
'src/module_community/java',
'src/module_album/java',
]
res.srcDirs = [
'src/main/res',
'src/common/res',
'src/module_public_chat_hall/res',
'src/module_upgrade_app/res',
'src/module_mentoring_relationship/res',
'src/module_labour_union/res',
'src/module_room_chat/res',
'src/model_customer_server/res',
'src/module_music/res',
'src/module_mini_world/res',
'src/module_lottery_dialog/res',
'src/module_bank_card/res',
'src/module_super_admin/res',
'src/module_treasure_box/res',
'src/module_community/res',
'src/module_album/res',
]
jniLibs.srcDirs = ['libs', 'aliyun-libs']
}
}
buildTypes {
def server_url_debug = '"http://beta.api.pekolive.com/"'
def server_url_release = '"https://api.pekolive.com/"'
debug {
println("minifyEnabled = " + minify_enabled)
ext.enableCrashlytics = false
ext.alwaysUpdateBuildId = false // Firebase Crashlytics禁用更新构建ID
buildConfigField "String", "BASE_URL", server_url_debug
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
buildConfigField "String", "BASE_URL_STAGING", "BASE_URL"
buildConfigField "String", "BASE_URL_RELEASE", server_url_release
minifyEnabled minify_enabled.toBoolean() // 是否混淆
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
crunchPngs false // 停用 PNG 压缩
signingConfig signingConfigs.v2
gradle.taskGraph.whenReady {
tasks.each { task ->
if (task.name.contains("Test") || task.name.contains("Lint")) {
task.enabled = false // 跳过 Test 和 Lint 相关的 Task
}
}
}
}
release {
ext.enableCrashlytics = CRASHLYTICS_COLLECTION_ENABLED.toBoolean()
ext.alwaysUpdateBuildId = CRASHLYTICS_COLLECTION_ENABLED.toBoolean()
firebaseCrashlytics {
//Firebase Crashlytics控制上传混淆文件开关
mappingFileUploadEnabled CRASHLYTICS_COLLECTION_ENABLED.toBoolean()
}
buildConfigField "String", "BASE_URL", server_url_release
buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL"
buildConfigField "String", "BASE_URL_STAGING", "BASE_URL"
buildConfigField "String", "BASE_URL_RELEASE", "BASE_URL"
minifyEnabled true // 是否混淆
shrinkResources true // 开了混淆的时候才能开启 是否去除无效的资源文件
zipAlignEnabled true // 开了混淆的时候才能开启 是否进行压缩并重排列
crunchPngs true // 启用 PNG 压缩
signingConfig signingConfigs.v2
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildToolsVersion = '30.0.3'
}
def Lombok = "1.18.24"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation fileTree(dir: 'aliyun-libs', include: ['*.jar', '*.aar'])
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
api 'androidx.multidex:multidex:2.0.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
api "com.orhanobut:dialogplus:1.11@aar"
api "com.readystatesoftware.systembartint:systembartint:1.0.4"
api "com.rengwuxian.materialedittext:library:2.1.4"
api "com.github.flavienlaurent.datetimepicker:library:0.0.2"
api "com.darsh.multipleimageselect:multipleimageselect:1.0.4"
api "me.shaohui.advancedluban:library:1.3.5"
api "pl.droidsonroids.gif:android-gif-drawable:1.2.24"
api "com.makeramen:roundedimageview:2.3.0"
api "com.jzxiang.pickerview:TimePickerDialog:1.0.1"
api "com.github.zyyoona7:EasyPopup:1.0.2"
api "com.github.donkingliang:LabelsView:1.6.5"
api "com.github.yyued:SVGAPlayer-Android:2.6.1"
implementation "com.orhanobut:logger:2.2.0"
api "com.ms-square:expandableTextView:0.1.4"
annotationProcessor 'androidx.annotation:annotation:1.4.0'
implementation 'io.github.h07000223:flycoTabLayout:3.0.0'
api project(':core')
implementation 'com.github.qiujayen:sticky-layoutmanager:1.0.1'
implementation 'com.github.chenBingX:SuperTextView:v3.0.0'
//支付密码输入框
api 'com.jungly:gridPasswordView:0.3'
api 'com.google.android.flexbox:flexbox:3.0.0'
compileOnly "org.projectlombok:lombok:${Lombok}"
annotationProcessor "org.projectlombok:lombok:${Lombok}"
implementation 'nl.dionsegijn:konfetti:1.1.2'
//数字滚动效果
implementation 'com.github.YvesCheung:RollingText:1.2.3'
// 引入原有第三方裁图源码,方便修改
api project(':android_crop_lib')
//rx权限请求框架
implementation('com.github.tbruyelle:rxpermissions:0.10.2') {
exclude group: 'io.reactivex.rxjava2'
}
//验证码控件 https://github.com/JingYeoh/VercodeEditText
implementation 'com.justkiddingbaby:vercodeedittext:1.1.0'
implementation 'it.sephiroth.android.library.imagezoom:library:1.0.4'
implementation 'com.github.fodroid:XRadioGroup:v1.5'
api 'com.tencent.vasdolly:helper:3.0.6'
implementation "io.github.tencent:vap:2.0.24"
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
implementation 'com.appsflyer:af-android-sdk:6.8.2'
implementation 'com.github.zhpanvip:BannerViewPager:3.5.6'
//fireBase
implementation platform('com.google.firebase:firebase-bom:31.1.1')
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
//Adjust接入
implementation 'com.adjust.sdk:adjust-android:4.33.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
// Add the following if you are using the Adjust SDK inside web views on your app
implementation 'com.adjust.sdk:adjust-android-webbridge:4.33.0'
implementation 'com.github.yalantis:ucrop:2.2.7'
implementation 'com.github.lihangleo2:ShadowLayout:3.3.2'
//wheelView
implementation 'com.contrarywind:wheelview:4.1.0'
implementation 'tech.sud.mgp:SudMGP-static:1.3.3.1158'
implementation 'com.google.android.material:material:1.9.0'
}
channel {
//多渠道包的输出目录默认为new File(project.buildDir,"channel")
outputDir = new File(project.buildDir, "channelapk")
//多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime}
def only64 = onlyArm64 ? "-only64" : ""
apkNameFormat = 'piko-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64)
//快速模式生成渠道包时不进行校验速度可以提升10倍以上默认为false
fastMode = false
//buildTime的时间格式默认格式yyyyMMdd-HHmmss
buildTimeDateFormat = 'MMddHHmm'
//低内存模式仅针对V2签名默认为false只把签名块、中央目录和EOCD读取到内存不把最大头的内容块读取到内存在手机上合成APK时可以使用该模式
lowMemory = false
}