2024-03-07 21:00:40 +08:00
|
|
|
plugins {
|
|
|
|
id 'com.android.application'
|
|
|
|
id 'org.jetbrains.kotlin.android'
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
namespace 'com.heeeeka.card'
|
|
|
|
compileSdk 34
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "com.heeeeka.card"
|
|
|
|
minSdk 21
|
|
|
|
targetSdk 34
|
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
|
|
|
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
|
2024-03-08 14:33:36 +08:00
|
|
|
signingConfigs {
|
|
|
|
release {
|
|
|
|
storeFile file('../card.jks')
|
|
|
|
storePassword "card2024"
|
|
|
|
keyAlias "card"
|
|
|
|
keyPassword "card2024"
|
|
|
|
v2SigningEnabled true
|
|
|
|
v1SigningEnabled true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-07 21:00:40 +08:00
|
|
|
buildTypes {
|
|
|
|
release {
|
2024-03-08 14:33:36 +08:00
|
|
|
minifyEnabled true
|
|
|
|
shrinkResources true // 开了混淆的时候才能开启 是否去除无效的资源文件
|
|
|
|
zipAlignEnabled true // 开了混淆的时候才能开启 是否进行压缩并重排列
|
|
|
|
crunchPngs true // 启用 PNG 压缩
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
signingConfig signingConfigs.release
|
|
|
|
}
|
|
|
|
debug{
|
2024-03-07 21:00:40 +08:00
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
2024-03-08 14:33:36 +08:00
|
|
|
signingConfig signingConfigs.release
|
2024-03-07 21:00:40 +08:00
|
|
|
}
|
|
|
|
}
|
2024-03-08 14:33:36 +08:00
|
|
|
|
2024-03-07 21:00:40 +08:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = '1.8'
|
|
|
|
}
|
|
|
|
buildFeatures {
|
|
|
|
viewBinding = true
|
|
|
|
}
|
2024-03-08 14:33:36 +08:00
|
|
|
|
|
|
|
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 = "card_${buildType.name}_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${abi}_${date}.apk"
|
|
|
|
}
|
|
|
|
}
|
2024-03-07 21:00:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
|
|
|
implementation 'androidx.core:core-ktx:1.10.1'
|
|
|
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
|
|
implementation 'com.google.android.material:material:1.9.0'
|
|
|
|
testImplementation 'junit:junit:4.13.2'
|
|
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
|
|
|
|
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
|
|
|
|
implementation 'com.geyifeng.immersionbar:immersionbar:3.2.2'
|
|
|
|
implementation 'io.github.cymchad:BaseRecyclerViewAdapterHelper4:4.1.4'
|
|
|
|
}
|