From 3569a13b74f83ff623a2fa18c36f00e10da264bf Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 19 Apr 2017 10:48:58 -0700 Subject: [PATCH] Make bintray parameters optional Summary: By declaring the properties first, before using them in the scripts, you no longer get an exception if you fail to specify them. You can now build artifacts or run tests without specifying your bintray password, which is probably what you want. Reviewed By: emilsjolander Differential Revision: D4913103 fbshipit-source-id: 8787af8973cebb84cd59e18c63a3a9f28e0ec348 --- gradle.properties | 4 ++++ gradle/android-jcenter-install.gradle | 8 ++++---- java/build.gradle | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 gradle.properties diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..62de2e58 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +bintrayUsername= +bintrayApiKey= +bintrayGpgPassword= +dryRun=false diff --git a/gradle/android-jcenter-install.gradle b/gradle/android-jcenter-install.gradle index 51c66319..72af7ca5 100644 --- a/gradle/android-jcenter-install.gradle +++ b/gradle/android-jcenter-install.gradle @@ -12,19 +12,19 @@ ext { } def getBintrayUsername() { - return hasProperty('bintrayUsername') ? property('bintrayUsername') : System.getenv('BINTRAY_USERNAME') + return property('bintrayUsername') || System.getenv('BINTRAY_USERNAME') } def getBintrayApiKey() { - return hasProperty('bintrayApiKey') ? property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') + return property('bintrayApiKey') || System.getenv('BINTRAY_API_KEY') } def getBintrayGpgPassword() { - return hasProperty('bintrayGpgPassword') ? property('bintrayGpgPassword') : System.getenv('BINTRAY_GPG_PASSWORD') + return property('bintrayGpgPassword') || System.getenv('BINTRAY_GPG_PASSWORD') } def dryRunOnly() { - return hasProperty('dryRun') ? property('dryRun').toBoolean() : false + return hasProperty('dryRun') ? property('dryRun').toBoolean() : false } def pomConfig = { diff --git a/java/build.gradle b/java/build.gradle index 28ac9f0f..0233c095 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -1,4 +1,4 @@ -apply plugin: "com.jfrog.bintray" +apply plugin: 'com.jfrog.bintray' apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'maven-publish'