Skip to content

Commit

Permalink
Fixes project build for devs without keystore file
Browse files Browse the repository at this point in the history
Change-Id: I818a1f7e326340d7113335df2b60b8080fe2d000
  • Loading branch information
Fleker committed Feb 20, 2019
1 parent 48065d4 commit 5fdbe0a
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions library/build.gradle
Expand Up @@ -117,25 +117,29 @@ publishing {
}
}

// Load keystore
def keystorePropertiesFile = rootProject.file("keystore.properties");
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

bintray {
user = keystoreProperties['BINTRAY_USER']
key = keystoreProperties['BINTRAY_API_KEY']
publications = ['libraryPublish']
publish = true
pkg {
repo = 'tif-companion'
name = 'tif-companion'
userOrg = 'google'
version {
name = packageVersion
gpg {
sign = true
// Optionally load keystore
if (file("$rootProject/keystore.properties").exists()) {
def keystorePropertiesFile = rootProject.file("keystore.properties");
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

bintray {
user = keystoreProperties['BINTRAY_USER']
key = keystoreProperties['BINTRAY_API_KEY']
publications = ['libraryPublish']
publish = true
pkg {
repo = 'tif-companion'
name = 'tif-companion'
userOrg = 'google'
version {
name = packageVersion
gpg {
sign = true
}
}
}
}
} else {
println "Warning: keystore file does not exist. Library revision cannot be published."
}

0 comments on commit 5fdbe0a

Please sign in to comment.