TiebaLite/app/build.gradle

165 lines
6.1 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'AndResGuard'
apply plugin: 'io.michaelrocks.paranoid'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.17'
classpath 'io.michaelrocks:paranoid-gradle-plugin:0.2.5'
}
}
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties")))
def applicationProperties = new Properties()
applicationProperties.load(new FileInputStream(rootProject.file("application.properties")))
def SHA1 = System.getenv("CIRCLE_SHA1")
def applicationVersionCode = applicationProperties["versionCode"].toInteger()
def applicationVersionName = applicationProperties["versionName"]
def isPerVersion = applicationProperties["isPerVersion"] == "true"
if (SHA1 != null) {
applicationVersionName = applicationVersionName + ".${SHA1.substring(0, 8)}"
}
if (isPerVersion) {
applicationVersionName = applicationVersionName + "-${applicationProperties["perVersion"]}"
}
andResGuard {
mappingFile = null
use7zip = true
useSign = true
keepRoot = false
mergeDuplicatedRes = true
whiteList = ["R.mipmap.ic_launcher",
"R.mipmap.ic_launcher_foreground",
"R.mipmap.ic_launcher_round",
"R.drawable.ic_*",
"R.color.theme_color_*",
"R.id.*"]
compressFilePattern = ["*.png",
"*.jpg",
"*.jpeg",
"*.gif",
"*.webp",
"*.kotlin_metadata",
"resources.arsc"]
sevenzip {
artifact = 'com.tencent.mm:SevenZip:1.2.10'
}
finalApkBackupPath = "${project.rootDir}/app/release/${applicationVersionName}(${applicationVersionCode}).apk"
digestalg = "SHA-256"
}
android {
signingConfigs {
release {
keyAlias keystoreProperties['releaseKeyAlias']
keyPassword keystoreProperties['releaseKeyPassword']
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProperties['releaseKeyStore'])
storePassword keystoreProperties['releaseStorePassword']
v2SigningEnabled true
}
}
compileSdkVersion 29
defaultConfig {
applicationId "com.huanchengfly.tieba.post"
minSdkVersion 21
targetSdkVersion 29
versionCode applicationVersionCode
versionName applicationVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
project.ext.set("archivesBaseName", "${versionName}(${versionCode})".toString())
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable false
jniDebuggable false
signingConfig signingConfigs.release
zipAlignEnabled true
multiDexEnabled true
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation 'org.jetbrains:annotations:19.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
//Local Files
implementation project(':SwipeBackLib')
implementation fileTree(include: ['*.jar'], dir: 'libs')
//兼容 Glide
implementation 'com.android.support:support-annotations:28.0.0'
kapt "com.android.support:support-annotations:28.0.0"
//AndroidX
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-rc1'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
//Test
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
implementation 'com.google.android.material:material:1.3.0-alpha02'
implementation 'com.squareup.okhttp3:okhttp:4.5.0'
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
implementation 'com.tsy:myokhttp:1.1.4'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'cn.dreamtobe.kpswitch:library:1.6.2'
implementation 'org.litepal.android:java:3.0.0'
implementation 'com.github.SheHuan:RecyclerViewAdapter:1.2.6'
implementation 'com.lapism:searchview:27.1.1.0.0'
implementation 'com.github.lygttpod:SuperTextView:2.1.8'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'com.bm.photoview:library:1.4.1'
implementation 'cn.jzvd:jiaozivideoplayer:7.2.3'
implementation 'com.jrummyapps:colorpicker:2.1.7'
implementation 'com.zhihu.android:matisse:0.5.3-beta3'
implementation 'com.yanzhenjie:permission:2.0.3'
implementation 'com.gyf.immersionbar:immersionbar:3.0.0-beta02'
api 'com.flurry.android:analytics:12.2.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.github.yalantis:ucrop:2.2.4'
implementation 'com.billy.android:pre-loader:2.1.0'
implementation 'com.jakewharton:butterknife:10.2.1'
kapt 'com.jakewharton:butterknife-compiler:10.2.1'
}