You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/10/24 22:18:35 UTC
[04/12] android commit: gradle: Allow absolute paths to keystore files
gradle: Allow absolute paths to keystore files
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/77c51d3a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/77c51d3a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/77c51d3a
Branch: refs/heads/unplug-whitelist
Commit: 77c51d3ae7ddbd79afe30100600fa5e155bcbaa7
Parents: 53dae45
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Oct 21 12:43:30 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Oct 21 12:43:30 2014 -0400
----------------------------------------------------------------------
bin/templates/project/build.gradle | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/77c51d3a/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index 2e4d5cb..974a19f 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -180,14 +180,21 @@ def ensureValueExists(filePath, props, key) {
def addSigningProps(propsFilePath, signingConfig) {
def propsFile = file(propsFilePath)
+ def props = new Properties()
propsFile.withReader { reader ->
- def props = new Properties()
props.load(reader)
- signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias')
- signingConfig.keyPassword = props.get('keyPassword')
- signingConfig.storeFile = RelativePath.parse(true, ensureValueExists(propsFilePath, props, 'storeFile')).getFile(propsFile.getParentFile())
- signingConfig.storePassword = props.get('storePassword')
}
+ def storeFile = new File(ensureValueExists(propsFilePath, props, 'storeFile'))
+ if (!storeFile.isAbsolute()) {
+ storeFile = RelativePath.parse(true, storeFile.toString()).getFile(propsFile.getParentFile())
+ }
+ if (!storeFile.exists()) {
+ throw new FileNotFoundException('Keystore file does not exist: ' + storeFile.getAbsolutePath())
+ }
+ signingConfig.keyAlias = ensureValueExists(propsFilePath, props, 'keyAlias')
+ signingConfig.keyPassword = props.get('keyPassword')
+ signingConfig.storeFile = storeFile
+ signingConfig.storePassword = props.get('storePassword')
}
if (file('build-extras.gradle').exists()) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org