Files
ElderlyDialer/app/build.gradle

213 lines
8.2 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'
static def appName() {
return "TTStdElderlyDialer"
}
static def releaseTime() {
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
}
android {
compileSdkVersion 29
// buildToolsVersion "36.0.0"
defaultConfig {
applicationId "com.ttstd.dialer"
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
ndk {
//根据需要 自行选择添加的对应cpu类型的.so库。
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// 还可以添加 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64', 'mips', 'mips64'
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
dataBinding {
enabled true
}
buildConfigField "String", "QweatherId", "\"${qweatherConfigs.credential.id}\""
buildConfigField "String", "QweatherKey", "\"${qweatherConfigs.credential.key}\""
}
signingConfigs {
keypub {
storeFile file(rootProject.ext.signingConfigs.keypub.storeFile)
storePassword rootProject.ext.signingConfigs.keypub.storePassword
keyAlias rootProject.ext.signingConfigs.keypub.keyAlias
keyPassword rootProject.ext.signingConfigs.keypub.keyPassword
}
}
buildTypes {
debug {
versionNameSuffix "_debug"
debuggable true
minifyEnabled false
//Zipalign优化
zipAlignEnabled true
signingConfig signingConfigs.keypub
applicationVariants.all { variant ->
variant.outputs.each { output ->
if (outputFile != null) {
def fileName = "${appName()}_V${defaultConfig.versionName}_${releaseTime()}.apk"
output.outputFileName = fileName
}
}
}
}
release {
minifyEnabled false
//Zipalign优化
zipAlignEnabled true
//前一部分代表系统默认的android程序的混淆文件该文件已经包含了基本的混淆声明后一个文件是自己的定义混淆文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//签名
signingConfig signingConfigs.keypub
// 将release版本的包名重命名加上版本及日期
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = ""
if (outputFile != null) {
def fileName = "${appName()}_${variant.versionCode}_V${variant.versionName}_${releaseTime()}_${buildType.name}.apk"
output.outputFileName = new File(outputFile, fileName)
}
}
}
}
}
}
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
//Android 4.4+
implementation files('libs/QWeather_Public_Android_V4.20.jar')
implementation project(path: ':niceimageview')
implementation project(path: ':iconloader')
//保持1.3.1 更新会报错
implementation 'androidx.appcompat:appcompat:1.3.1'
//2.0.4以上无法预览
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation "androidx.recyclerview:recyclerview:1.2.1"
// For control over item selection of both touch and mouse driven selection
implementation "androidx.recyclerview:recyclerview-selection:1.1.0"
// Java language implementation
implementation "androidx.fragment:fragment:1.4.1"
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
// Room依赖
implementation "androidx.room:room-runtime:2.3.0"
implementation "androidx.room:room-rxjava3:2.3.0"
annotationProcessor "androidx.room:room-compiler:2.3.0"
// ViewModel和LiveData
implementation "androidx.lifecycle:lifecycle-viewmodel:2.3.0"
implementation "androidx.lifecycle:lifecycle-livedata:2.3.0"
implementation "androidx.lifecycle:lifecycle-runtime:2.3.0"
annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.3.0"
// 添加这行,使用 BOM 统一 Kotlin 相关库的版本
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.10"))
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
implementation 'com.google.android.material:material:1.0.0'
//glide
implementation 'com.github.bumptech.glide:glide:4.13.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.1'
//RxJava
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
//
implementation 'com.squareup.okhttp3:okhttp:4.7.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
// implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
//Gson
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.google.zxing:core:3.5.0'
//生命周期管理
implementation 'com.trello.rxlifecycle4:rxlifecycle:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-android:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-components:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-components-preference:4.0.2'
implementation 'com.trello.rxlifecycle4:rxlifecycle-android-lifecycle:4.0.2'
implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
/*https://github.com/JeremyLiao/LiveEventBus*/
implementation 'com.jeremyliao:live-event-bus-x:1.7.3'
implementation 'com.facebook.rebound:rebound:0.3.8'
//MMKV
implementation 'com.tencent:mmkv-static:1.2.14'
//bugly
implementation 'com.tencent.bugly:crashreport:4.1.9.3'
implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.0.0'
// 替换成最新版本, 需要注意的是api
// 要与compiler匹配使用均使用最新版可以保证兼容
implementation 'com.alibaba:arouter-api:1.5.2'
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
//地图组件
implementation 'com.baidu.lbsyun:BaiduMapSDK_Map:7.6.4'
//基础定位组件
implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.6.4'
//全量定位组件
// implementation 'com.baidu.lbsyun:BaiduMapSDK_Location_All:9.6.4'
//TTS组件
implementation 'com.baidu.lbsyun:NaviTts:3.2.13'
//指示器
implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
//工具类
implementation 'com.blankj:utilcodex:1.31.0'
//aria
implementation 'com.arialyy.aria:core:3.8.15'
annotationProcessor 'com.arialyy.aria:compiler:3.8.15'
//状态栏透明
implementation 'com.gitee.zackratos:UltimateBarX:0.8.0'
//指示器
implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
// 吐司框架https://github.com/getActivity/Toaster
implementation 'com.github.getActivity:Toaster:12.6'
// 权限请求框架https://github.com/getActivity/XXPermissions
implementation 'com.github.getActivity:XXPermissions:20.0'
//autosize会改变第三方view的大小
//https://github.com/JessYanCoding/AndroidAutoSize
implementation 'me.jessyan:autosize:1.2.1'
}