2021-07-20 14:26:11 +08:00
|
|
|
plugins {
|
|
|
|
|
id "com.android.application"
|
|
|
|
|
id "kotlin-android"
|
|
|
|
|
id "kotlin-kapt"
|
2020-04-05 13:15:03 +08:00
|
|
|
}
|
|
|
|
|
|
2020-04-05 19:04:01 +08:00
|
|
|
def keystoreProperties = new Properties()
|
|
|
|
|
keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties")))
|
|
|
|
|
def applicationProperties = new Properties()
|
|
|
|
|
applicationProperties.load(new FileInputStream(rootProject.file("application.properties")))
|
2022-02-06 20:52:46 +08:00
|
|
|
def buildId = System.getenv("APPCENTER_BUILD_ID")
|
2020-04-05 19:04:01 +08:00
|
|
|
def applicationVersionCode = applicationProperties["versionCode"].toInteger()
|
|
|
|
|
def applicationVersionName = applicationProperties["versionName"]
|
2020-08-22 11:19:36 +08:00
|
|
|
def isPerVersion = applicationProperties["isPerRelease"] == "true"
|
2022-02-06 20:52:46 +08:00
|
|
|
if (buildId != null) {
|
2022-02-06 21:42:03 +08:00
|
|
|
applicationVersionName = applicationVersionName + ".${buildId}"
|
2020-04-05 21:49:14 +08:00
|
|
|
}
|
|
|
|
|
if (isPerVersion) {
|
2020-08-22 11:19:36 +08:00
|
|
|
applicationVersionName = applicationVersionName + ".${applicationProperties["preReleaseName"]}-${applicationProperties["preReleaseVer"]}"
|
2020-04-05 19:04:01 +08:00
|
|
|
}
|
2021-07-20 14:26:11 +08:00
|
|
|
project.ext.set("archivesBaseName", "${applicationVersionName}(${applicationVersionCode})".toString())
|
2020-04-05 19:04:01 +08:00
|
|
|
|
2020-04-05 13:15:03 +08:00
|
|
|
android {
|
2021-05-01 20:33:42 +08:00
|
|
|
compileSdkVersion 30
|
2021-07-20 14:26:11 +08:00
|
|
|
buildToolsVersion "30.0.3"
|
2020-04-05 13:15:03 +08:00
|
|
|
defaultConfig {
|
2020-08-12 22:45:15 +08:00
|
|
|
applicationId "com.huanchengfly.tieba.post"
|
2020-04-05 13:15:03 +08:00
|
|
|
minSdkVersion 21
|
2021-08-19 16:53:19 +08:00
|
|
|
//noinspection OldTargetApi
|
2021-05-01 20:33:42 +08:00
|
|
|
targetSdkVersion 30
|
2020-04-05 19:04:01 +08:00
|
|
|
versionCode applicationVersionCode
|
|
|
|
|
versionName applicationVersionName
|
2020-04-05 13:15:03 +08:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
2021-12-03 18:53:03 +08:00
|
|
|
vectorDrawables {
|
|
|
|
|
useSupportLibrary true
|
|
|
|
|
}
|
2021-07-20 14:26:11 +08:00
|
|
|
}
|
|
|
|
|
signingConfigs {
|
|
|
|
|
release {
|
|
|
|
|
keyAlias keystoreProperties["releaseKeyAlias"]
|
|
|
|
|
keyPassword keystoreProperties["releaseKeyPassword"]
|
|
|
|
|
storeFile file(rootDir.getCanonicalPath() + "/" + keystoreProperties["releaseKeyStore"])
|
|
|
|
|
storePassword keystoreProperties["releaseStorePassword"]
|
|
|
|
|
v2SigningEnabled true
|
|
|
|
|
enableV3Signing true
|
|
|
|
|
enableV4Signing true
|
|
|
|
|
}
|
2020-04-05 13:15:03 +08:00
|
|
|
}
|
|
|
|
|
buildTypes {
|
|
|
|
|
release {
|
|
|
|
|
minifyEnabled true
|
|
|
|
|
shrinkResources true
|
2021-07-20 14:26:11 +08:00
|
|
|
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
2020-04-05 13:15:03 +08:00
|
|
|
debuggable false
|
|
|
|
|
jniDebuggable false
|
2020-04-05 15:08:33 +08:00
|
|
|
signingConfig signingConfigs.release
|
2020-04-05 13:15:03 +08:00
|
|
|
zipAlignEnabled true
|
|
|
|
|
multiDexEnabled true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
compileOptions {
|
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
|
}
|
2021-12-03 18:53:03 +08:00
|
|
|
kotlinOptions {
|
|
|
|
|
jvmTarget = '1.8'
|
|
|
|
|
useIR = true
|
|
|
|
|
}
|
|
|
|
|
packagingOptions {
|
|
|
|
|
resources {
|
|
|
|
|
excludes += '/META-INF/{AL2.0,LGPL2.1}'
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-04-05 13:15:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "org.jetbrains:annotations:19.0.0"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
|
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
2021-12-03 18:53:03 +08:00
|
|
|
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
|
|
|
|
|
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
|
|
|
|
|
|
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
|
2020-04-05 13:15:03 +08:00
|
|
|
|
|
|
|
|
//Local Files
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation fileTree(include: ["*.jar"], dir: "libs")
|
2020-04-05 13:15:03 +08:00
|
|
|
|
2020-08-15 16:25:18 +08:00
|
|
|
//滑动返回
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "me.imid.swipebacklayout.lib:library:1.3.0"
|
2020-08-15 16:25:18 +08:00
|
|
|
|
2020-04-05 13:15:03 +08:00
|
|
|
//兼容 Glide
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.android.support:support-annotations:28.0.0"
|
2021-08-19 16:53:19 +08:00
|
|
|
implementation "androidx.work:work-runtime:2.5.0"
|
2020-07-16 16:35:41 +08:00
|
|
|
kapt "com.android.support:support-annotations:28.0.0"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
|
|
|
|
//AndroidX
|
2021-08-19 16:53:19 +08:00
|
|
|
implementation "androidx.appcompat:appcompat:1.3.1"
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "androidx.core:core-ktx:1.6.0"
|
2021-12-03 19:04:16 +08:00
|
|
|
implementation "androidx.annotation:annotation:1.3.0"
|
2021-12-03 18:53:03 +08:00
|
|
|
implementation "androidx.constraintlayout:constraintlayout:2.1.1"
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "androidx.preference:preference-ktx:1.1.1"
|
|
|
|
|
implementation "androidx.gridlayout:gridlayout:1.0.0"
|
|
|
|
|
implementation "androidx.browser:browser:1.3.0"
|
|
|
|
|
implementation "androidx.viewpager2:viewpager2:1.0.0"
|
|
|
|
|
implementation "androidx.palette:palette-ktx:1.0.0"
|
2022-04-10 10:08:58 +08:00
|
|
|
implementation "androidx.window:window:1.0.0-beta03"
|
|
|
|
|
implementation "androidx.startup:startup-runtime:1.1.0"
|
|
|
|
|
|
2020-04-05 13:15:03 +08:00
|
|
|
|
|
|
|
|
//Test
|
2021-07-20 14:26:11 +08:00
|
|
|
testImplementation "junit:junit:4.13.2"
|
|
|
|
|
androidTestImplementation "androidx.test:core:1.4.0"
|
|
|
|
|
androidTestImplementation "androidx.test.ext:junit:1.1.3"
|
|
|
|
|
androidTestImplementation "androidx.test:rules:1.4.0"
|
|
|
|
|
androidTestImplementation "androidx.test:runner:1.4.0"
|
|
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
|
|
|
|
//Glide
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.github.bumptech.glide:glide:$glide_version"
|
|
|
|
|
kapt "com.github.bumptech.glide:compiler:$glide_version"
|
|
|
|
|
implementation "com.github.bumptech.glide:okhttp3-integration:$glide_version"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.google.android.material:material:1.4.0"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.squareup.okhttp3:okhttp:4.9.1"
|
|
|
|
|
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
|
|
|
|
|
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.google.code.gson:gson:2.8.7"
|
|
|
|
|
implementation "cn.dreamtobe.kpswitch:library:1.6.2"
|
|
|
|
|
implementation "org.litepal.android:kotlin:3.0.0"
|
|
|
|
|
implementation "com.github.SheHuan:RecyclerViewAdapter:1.2.9"
|
|
|
|
|
implementation "com.davemorrissey.labs:subsampling-scale-image-view:3.10.0"
|
|
|
|
|
implementation "com.bm.photoview:library:2.0.7"
|
|
|
|
|
implementation "cn.jzvd:jiaozivideoplayer:7.7.0"
|
|
|
|
|
implementation "com.jrummyapps:colorpicker:2.1.7"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.scwang.smart:refresh-layout-kernel:2.0.1"
|
|
|
|
|
implementation "com.scwang.smart:refresh-header-material:2.0.1"
|
2020-08-28 18:33:09 +08:00
|
|
|
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.zhihu.android:matisse:0.5.3-beta3"
|
|
|
|
|
implementation "com.yanzhenjie:permission:2.0.3"
|
|
|
|
|
implementation "com.gyf.immersionbar:immersionbar:3.0.0"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.github.yalantis:ucrop:2.2.7"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.billy.android:pre-loader:2.1.0"
|
2020-04-05 13:15:03 +08:00
|
|
|
|
2021-07-20 14:26:11 +08:00
|
|
|
implementation "com.jakewharton:butterknife:10.2.3"
|
|
|
|
|
kapt "com.jakewharton:butterknife-compiler:10.2.3"
|
2020-08-22 22:22:06 +08:00
|
|
|
|
2021-12-03 18:53:03 +08:00
|
|
|
implementation ("com.alibaba.android:vlayout:1.2.31@aar") {
|
2020-08-22 22:22:06 +08:00
|
|
|
transitive = true
|
|
|
|
|
}
|
2021-12-03 19:04:16 +08:00
|
|
|
|
|
|
|
|
def appCenterSdkVersion = '4.3.1'
|
|
|
|
|
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
|
|
|
|
|
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
|
2021-12-03 20:36:11 +08:00
|
|
|
implementation "com.microsoft.appcenter:appcenter-distribute:${appCenterSdkVersion}"
|
2020-04-05 13:15:03 +08:00
|
|
|
}
|