Add sign config

This commit is contained in:
tehcneko 2023-11-23 14:45:49 +08:00
parent a3ace59dee
commit 39f5649cc0

View File

@ -14,8 +14,34 @@ android {
versionName "2.2.0"
}
Properties localProperties = new Properties()
if (project.rootProject.file('local.properties').exists()) {
localProperties.load(project.rootProject.file('local.properties').newDataInputStream())
}
signingConfigs {
if (localProperties.getProperty("storeFile") != null) {
config {
storeFile file(localProperties.getProperty("storeFile"))
storePassword localProperties.getProperty("storePassword")
keyAlias localProperties.getProperty("keyAlias")
keyPassword localProperties.getProperty("keyPassword")
}
}
}
buildTypes {
debug {
if (localProperties.getProperty("storeFile") != null) {
signingConfig signingConfigs.config
}
}
release {
if (localProperties.getProperty("storeFile") != null) {
signingConfig signingConfigs.config
} else {
signingConfig signingConfigs.debug
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}