Summary: Reuse the gradle setup we've built for Litho which allows for parallel publishing to Bintray and Maven Central in addition to Sonatype Snapshots. This appears not to break the existing jcenter deploy script which is pretty great. Reviewed By: emilsjolander Differential Revision: D5020576 fbshipit-source-id: 3ef163ccbfe91c6858b051d39dcf237ca388e18d
64 lines
2.0 KiB
Groovy
64 lines
2.0 KiB
Groovy
// Upload to Bintray
|
|
apply plugin: 'com.jfrog.bintray'
|
|
|
|
def getBintrayUsername() {
|
|
return project.hasProperty('bintrayUsername') ? property('bintrayUsername') : System.getenv('BINTRAY_USERNAME')
|
|
}
|
|
|
|
def getBintrayApiKey() {
|
|
return project.hasProperty('bintrayApiKey') ? property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
|
|
}
|
|
|
|
def getBintrayGpgPassword() {
|
|
return project.hasProperty('bintrayGpgPassword') ? property('bintrayGpgPassword') : System.getenv('BINTRAY_GPG_PASSWORD')
|
|
}
|
|
|
|
def getMavenCentralUsername() {
|
|
return project.hasProperty('mavenCentralUsername') ? property('mavenCentralUsername') : System.getenv('MAVEN_CENTRAL_USERNAME')
|
|
}
|
|
|
|
def getMavenCentralPassword() {
|
|
return project.hasProperty('mavenCentralPassword') ? property('mavenCentralPassword') : System.getenv('MAVEN_CENTRAL_PASSWORD')
|
|
}
|
|
|
|
def shouldSyncWithMavenCentral() {
|
|
return project.hasProperty('syncWithMavenCentral') ? property('syncWithMavenCentral').toBoolean() : false
|
|
}
|
|
|
|
def dryRunOnly() {
|
|
return project.hasProperty('dryRun') ? property('dryRun').toBoolean() : false
|
|
}
|
|
|
|
bintray {
|
|
user = getBintrayUsername()
|
|
key = getBintrayApiKey()
|
|
configurations = ['archives']
|
|
pkg {
|
|
repo = bintrayRepo
|
|
userOrg = bintrayUserOrg
|
|
name = bintrayName
|
|
desc = bintrayDescription
|
|
websiteUrl = projectUrl
|
|
issueTrackerUrl = issuesUrl
|
|
vcsUrl = scmUrl
|
|
licenses = projectLicenses
|
|
dryRun = dryRunOnly()
|
|
override = true
|
|
publish = true
|
|
publicDownloadNumbers = true
|
|
version {
|
|
desc = bintrayDescription
|
|
gpg {
|
|
sign = true
|
|
passphrase = getBintrayGpgPassword()
|
|
}
|
|
mavenCentralSync {
|
|
sync = shouldSyncWithMavenCentral()
|
|
user = getMavenCentralUsername()
|
|
password = getMavenCentralPassword()
|
|
close = '1' // If set to 0, you have to manually click release
|
|
}
|
|
}
|
|
}
|
|
}
|