From eef4301d5439f51a418d27a9509e4e3812e2f348 Mon Sep 17 00:00:00 2001 From: Dierk Koenig Date: Fri, 4 Sep 2015 15:30:17 +0200 Subject: travis has no gradle properties under home dir, so make that optional --- build.gradle | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index bcf47c5..0e5f6ad 100644 --- a/build.gradle +++ b/build.gradle @@ -18,12 +18,14 @@ ext { // work around https://issues.gradle.org/browse/GRADLE-3281 def home = new File(System.getProperty("user.home")) def propfile = new File(home, ".gradle/gradle.properties") - props = new Properties() - propfile.withReader { - props.load(it) - System.setProperty "gradle.publish.key" , props.'gradle.publish.key' - System.setProperty "gradle.publish.secret", props.'gradle.publish.secret' - } + if (propfile.exists()) { + props = new Properties() + propfile.withReader { + props.load(it) + System.setProperty "gradle.publish.key", props.'gradle.publish.key' + System.setProperty "gradle.publish.secret", props.'gradle.publish.secret' + } + } else println "cannot find '$propfile.absolutePath'" } version = projectVersion -- cgit