From 98195890cba1807e5ad54c7c69692b17bde4a344 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 18 Nov 2023 09:14:54 +0100 Subject: [PATCH] Optional keystore properties --- app/build.gradle | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7f491cc72b..3666497bc2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,8 @@ def getReleaseName = { -> return "Vallibonavenatrix" } // https://en.wikipedia.org/wiki/List_of_dinosaur_genera def keystoreProperties = new Properties() -keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties"))) +if (rootProject.file("keystore.properties").exists()) + keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties"))) Properties localProperties = new Properties() if (rootProject.file("local.properties").exists()) @@ -135,15 +136,17 @@ android { } } - // https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.SigningConfig.html + // https://developer.android.com/reference/tools/gradle-api/4.2/com/android/build/api/dsl/SigningConfig signingConfigs { release { - storeFile file(keystoreProperties['storeFile']) - storePassword keystoreProperties['storePassword'] - keyAlias keystoreProperties['keyAlias'] - keyPassword keystoreProperties['keyPassword'] - v1SigningEnabled true - v2SigningEnabled true + if (rootProject.file("keystore.properties").exists()) { + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + v1SigningEnabled true + v2SigningEnabled true + } } }