diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-25 12:27:17 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-07-25 12:27:17 -0700 |
commit | 3a1561bbc9b6aab98370a4b51ef07ed05a92daa9 (patch) | |
tree | f586fc5789777dca485919719d8b85f72c83ec53 | |
parent | aaedf98c7c2eb9381c704367e040471cb2e9d094 (diff) | |
download | kau-3a1561bbc9b6aab98370a4b51ef07ed05a92daa9.tar.gz kau-3a1561bbc9b6aab98370a4b51ef07ed05a92daa9.tar.bz2 kau-3a1561bbc9b6aab98370a4b51ef07ed05a92daa9.zip |
Add checker for signing
-rw-r--r-- | sample/build.gradle | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sample/build.gradle b/sample/build.gradle index 6fdf24a..3350b3b 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -38,24 +38,28 @@ android { testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } - signingConfigs { + def releaseSigning = file("../files/kau.properties") + def hasSigning = releaseSigning.exists() - def releaseProps = new Properties() - file("../files/kau.properties").withInputStream { releaseProps.load(it) } + if (hasSigning) { + signingConfigs { - release { - storeFile file("../files/kau.keystore") - storePassword releaseProps.getProperty('storePassword') - keyAlias releaseProps.getProperty('keyAlias') - keyPassword releaseProps.getProperty('keyPassword') - } + def releaseProps = new Properties() + releaseSigning.withInputStream { releaseProps.load(it) } + release { + storeFile file("../files/kau.keystore") + storePassword releaseProps.getProperty('storePassword') + keyAlias releaseProps.getProperty('keyAlias') + keyPassword releaseProps.getProperty('keyPassword') + } + } } buildTypes { release { minifyEnabled true - signingConfig signingConfigs.release + if (hasSigning) signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } |