From b223c05a285201b3c5c3083d12377fd7f4b31790 Mon Sep 17 00:00:00 2001 From: Florian Meyer Date: Mon, 23 Dec 2024 21:01:46 +0100 Subject: [PATCH] make signing optional --- app/build.gradle.kts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8c4a6b4..fa3e71b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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()) } @@ -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") + } } } @@ -48,7 +51,9 @@ android { isDebuggable = true } release { - signingConfig = signingConfigs.getByName("signing") + if (hasSigningConfig) { + signingConfig = signingConfigs.getByName("signing") + } isDebuggable = false isMinifyEnabled = true isShrinkResources = true