import groovy.json.JsonSlurper
plugins {
id 'com.android.application'
}
//获取当前时间
def releaseTime() {
return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
}
def jsonFile = file('version.json')
def versionInfo = new JsonSlurper().parseText(jsonFile.text)
def fileName = releaseTime()+ "_"+versionInfo.versionCode
android {
compileSdkVersion 30
buildToolsVersion '28.0.3'
defaultConfig {
applicationId versionInfo.applicationId
minSdkVersion 19
targetSdkVersion 31
versionCode versionInfo.versionCode
versionName versionInfo.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
//签名配置
signingConfigs {
debugConfig {
storeFile file("xuexibao.keys")
storePassword "tyky\$123456"
keyAlias "tyky_czing"
keyPassword "tyky\$123456"
}
releaseConfig {
storeFile file("xuexibao.keys")
storePassword "tyky\$123456"
keyAlias "tyky_czing"
keyPassword "tyky\$123456"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
//自动签名的关键!!
signingConfig signingConfigs.releaseConfig
}
}
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "base_${fileName}.apk"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
//图片,视频,音频选择 https://github.com/LuckSiege/PictureSelector
implementation 'io.github.lucksiege:pictureselector:v2.7.3-rc08'
//Glide
implementation "com.github.bumptech.glide:glide:4.12.0"
//权限申请
implementation 'com.yanzhenjie:permission:2.0.3'
// Android的工具类 https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/README-CN.md
implementation 'com.blankj:utilcodex:1.30.6'
//日志输出 https://github.com/ZhaoKaiQiang/KLog
implementation 'com.github.zhaokaiqiang.klog:library:1.6.0'
}
版权归属:
Stars-one
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区