From cce137891d2223a1bd0c8cddbaba990b13325459 Mon Sep 17 00:00:00 2001 From: Victor Antonovich Date: Tue, 28 Sep 2021 23:01:27 +0300 Subject: [PATCH] [app] Check local.properties file presence in release signing config --- app/build.gradle | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ca210d0..6618b38 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,12 +17,15 @@ android { // Release management signingConfigs { release { - Properties properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - keyAlias properties.getProperty('key.alias') - keyPassword properties.getProperty('key.password') - storeFile file(properties.getOrDefault('key.store.file', 'release.keystore')) - storePassword properties.getProperty('key.store.password') + File propsFile = project.rootProject.file('local.properties') + if (propsFile.exists()) { + Properties properties = new Properties() + properties.load(propsFile.newDataInputStream()) + keyAlias properties.getProperty('key.alias') + keyPassword properties.getProperty('key.password') + storeFile file(properties.getOrDefault('key.store.file', 'release.keystore')) + storePassword properties.getProperty('key.store.password') + } } } buildTypes {