From 292a7af6fd663d73f143d0db96bf0ea887768298 Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Mon, 11 Jan 2016 12:19:18 +0100 Subject: [PATCH] Make signing configuration optional. + This will make it easier for new contributors to build the project. --- studio/app/build.gradle | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/studio/app/build.gradle b/studio/app/build.gradle index 31c7eb01..2d6cc3c3 100644 --- a/studio/app/build.gradle +++ b/studio/app/build.gradle @@ -2,10 +2,6 @@ apply plugin: 'com.android.application' project.archivesBaseName = "opengpstracker" -def keystorePropertiesFile = rootProject.file("keystore.properties"); -def signingProperties = new Properties() -signingProperties.load(new FileInputStream(keystorePropertiesFile)) - android { compileSdkVersion "Google Inc.:Google APIs:23" buildToolsVersion '23.0.2' @@ -23,13 +19,7 @@ android { } signingConfigs { - all { - storeFile file(signingProperties["storeFile"]) - storePassword signingProperties["storePassword"] - keyAlias signingProperties["keyAlias"] - keyPassword signingProperties["keyPassword"] - } - release {} + release } buildTypes { @@ -65,3 +55,14 @@ dependencies { compile project(':service') testCompile 'junit:junit:4.12' } + +def keystorePropertiesFile = rootProject.file("keystore.properties"); +if (keystorePropertiesFile.exists()) { + def signingProperties = new Properties() + signingProperties.load(new FileInputStream(keystorePropertiesFile)) + def release = android.signingConfigs.release + release.storeFile = file(signingProperties["storeFile"]) + release.storePassword = signingProperties["storePassword"] + release.keyAlias = signingProperties["keyAlias"] + release.keyPassword = signingProperties["keyPassword"] +}