feat: add release signing config via signing.properties
This commit is contained in:
parent
20bb151d09
commit
9d2d3e6e91
1 changed files with 20 additions and 0 deletions
|
|
@ -3,6 +3,9 @@ plugins {
|
||||||
id 'org.jetbrains.kotlin.android'
|
id 'org.jetbrains.kotlin.android'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def signingPropsFile = rootProject.file('signing.properties')
|
||||||
|
def hasSigningConfig = signingPropsFile.exists()
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace 'nl.eddydevink.sylda'
|
namespace 'nl.eddydevink.sylda'
|
||||||
// compileSdk/targetSdk stays on 34 (Android 14) by deliberate choice. The target audience
|
// compileSdk/targetSdk stays on 34 (Android 14) by deliberate choice. The target audience
|
||||||
|
|
@ -10,6 +13,20 @@ android {
|
||||||
// on API 34 maximises device compatibility. Re-evaluate when the user base has migrated.
|
// on API 34 maximises device compatibility. Re-evaluate when the user base has migrated.
|
||||||
compileSdk 34
|
compileSdk 34
|
||||||
|
|
||||||
|
if (hasSigningConfig) {
|
||||||
|
def props = new Properties()
|
||||||
|
props.load(new FileInputStream(signingPropsFile))
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file(props['KEYSTORE_PATH'])
|
||||||
|
storePassword props['KEYSTORE_PASSWORD']
|
||||||
|
keyAlias props['KEY_ALIAS']
|
||||||
|
keyPassword props['KEY_PASSWORD']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "nl.eddydevink.sylda"
|
applicationId "nl.eddydevink.sylda"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
|
|
@ -25,6 +42,9 @@ android {
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
if (hasSigningConfig) {
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue