diff --git a/.gitignore b/.gitignore index f625d6f8..57157126 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ nb-configuration.xml ## Gradle .gradle +keystore.properties gradle-app.setting ## OS Specific diff --git a/app/build.gradle b/app/build.gradle index 4a39d833..3e495edf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,6 +25,23 @@ android { targetCompatibility 1.8 sourceCompatibility 1.8 } + + // optional signingConfigs + def keystorePropertiesFile = rootProject.file("keystore.properties") + if (keystorePropertiesFile.exists()) { + def keystoreProperties = new Properties() + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + } + buildTypes.release.signingConfig = signingConfigs.release + } } gradle.projectsEvaluated {