From 4d7a945c5303da1720ccfc36be288a09007eda05 Mon Sep 17 00:00:00 2001 From: Synced Synapse Date: Wed, 4 Mar 2015 19:01:58 +0000 Subject: [PATCH] Remove the need of creating extra files to build --- README.md | 7 +------ app/build.gradle | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 925f3be..0ab63e8 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,7 @@ Kore is a simple and easy to use Kodi/XBMC remote. Building --------- -Git pull should get you almost all you need, as long as you have a working [Android build system][4] - -You'll need to create the following files: - -1. `gradle.properties`, with the value `IAP_KEY` set to something (this is used for the in-app purchase). -2. `app/keystore.properties` with the values `store`, `alias`, `pass`, `storePass` set. This is for signing the release build. Alternatively, comment the `signingConfigs` in `app/build.gradle`. +Git pull should get you almost everything you need, as long as you have a working [Android build system][4] Credits diff --git a/app/build.gradle b/app/build.gradle index b4d46f5..ffd4846 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,18 +11,26 @@ android { versionCode 7 versionName "1.1.0" - buildConfigField("String", "IAP_KEY", "\"${rootProject.property("IAP_KEY")}\"") + if(rootProject.hasProperty("IAP_KEY")) { + buildConfigField("String", "IAP_KEY", "\"${rootProject.property("IAP_KEY")}\"") + } else { + buildConfigField("String", "IAP_KEY", "\"\"") + } } + File keystoreFile = file('keystore.properties') + signingConfigs { release { - def Properties keyProps = new Properties() - keyProps.load(new FileInputStream(file('keystore.properties'))) + if (keystoreFile.exists()) { + def Properties keyProps = new Properties() + keyProps.load(new FileInputStream(keystoreFile)) - storeFile file(keyProps["store"]) - keyAlias keyProps["alias"] - storePassword keyProps["storePass"] - keyPassword keyProps["pass"] + storeFile file(keyProps["store"]) + keyAlias keyProps["alias"] + storePassword keyProps["storePass"] + keyPassword keyProps["pass"] + } } } @@ -33,7 +41,9 @@ android { // } release { - signingConfig signingConfigs.release + if (keystoreFile.exists()) { + signingConfig signingConfigs.release + } minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }