Skip to content

Commit

Permalink
make signing optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Meyer committed Dec 23, 2024
1 parent 5d527fa commit b223c05
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ plugins {

val signingProperties = Properties()
val signingFile = file("keystore/sessiontimer.properties")
if (signingFile.exists()) {
val hasSigningConfig = signingFile.exists()
if (hasSigningConfig) {
signingProperties.load(signingFile.inputStream())
}

Expand All @@ -32,14 +33,16 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
create("signing") {
enableV3Signing = true
enableV4Signing = true
storeFile = file(signingProperties.getProperty("signing.storeFilePath"))
storePassword = signingProperties.getProperty("signing.storePassword")
keyAlias = signingProperties.getProperty("signing.keyAlias")
keyPassword = signingProperties.getProperty("signing.keyPassword")
if (hasSigningConfig) {
signingConfigs {
create("signing") {
enableV3Signing = true
enableV4Signing = true
storeFile = file(signingProperties.getProperty("signing.storeFilePath"))
storePassword = signingProperties.getProperty("signing.storePassword")
keyAlias = signingProperties.getProperty("signing.keyAlias")
keyPassword = signingProperties.getProperty("signing.keyPassword")
}
}
}

Expand All @@ -48,7 +51,9 @@ android {
isDebuggable = true
}
release {
signingConfig = signingConfigs.getByName("signing")
if (hasSigningConfig) {
signingConfig = signingConfigs.getByName("signing")
}
isDebuggable = false
isMinifyEnabled = true
isShrinkResources = true
Expand Down

0 comments on commit b223c05

Please sign in to comment.