build: 版本兼容升级

1. agp -> v8.1.0
2. gradle -> v8.0
3. 添加 gradle version catalogs 管理依赖,替换 buildSrc 方式,目前只将插件部分重构,其余依赖后续版本中重构
This commit is contained in:
Quyunshuo
2023-08-20 20:23:09 +08:00
parent 2fd0c18b29
commit 337f7fa15e
18 changed files with 130 additions and 115 deletions

View File

@ -4,28 +4,31 @@
import com.quyunshuo.androidbaseframemvvm.buildsrc.*
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
plugins {
alias(libs.plugins.application)
alias(libs.plugins.kotlin)
alias(libs.plugins.hilt)
id "kotlin-kapt"
}
android {
compileSdkVersion ProjectBuildConfig.compileSdkVersion
namespace 'com.quyunshuo.androidbaseframemvvm'
compileSdk ProjectBuildConfig.compileSdkVersion
defaultConfig {
applicationId ProjectBuildConfig.applicationId
minSdkVersion ProjectBuildConfig.minSdkVersion
targetSdkVersion ProjectBuildConfig.targetSdkVersion
minSdk ProjectBuildConfig.minSdkVersion
targetSdk ProjectBuildConfig.targetSdkVersion
versionCode ProjectBuildConfig.versionCode
versionName ProjectBuildConfig.versionName
testInstrumentationRunner DependencyConfig.AndroidX.AndroidJUnitRunner
multiDexKeepProguard file("multidexKeep.pro")
ndk {
// 设置支持的SO库架构
//abiFilters 'armeabi', 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86','x86_64'
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
@ -74,14 +77,13 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}
namespace 'com.quyunshuo.androidbaseframemvvm'
}
dependencies {

View File

@ -1,27 +1,20 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# 避免 ViewBinding 类被混淆导致反射初始化失败
-keep public interface androidx.viewbinding.ViewBinding
-keepclassmembers class * implements androidx.viewbinding.ViewBinding{
*;
}
}
# AGP 8.x 警告生成
# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn dalvik.system.VMStack
-dontwarn javax.lang.model.element.Element
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.Conscrypt$Version
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE