2017-02-23 04:57:18 -08:00
|
|
|
ext {
|
|
|
|
bintrayUserOrg = 'facebook'
|
|
|
|
bintrayRepo = 'maven'
|
|
|
|
siteURL = "https://facebook.github.io/yoga/"
|
|
|
|
projectLicenses = {
|
|
|
|
license {
|
|
|
|
name 'BSD License'
|
|
|
|
url 'https://github.com/facebook/yoga/blob/master/LICENSE'
|
|
|
|
distribution 'repo'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def getBintrayUsername() {
|
2017-04-19 10:48:58 -07:00
|
|
|
return property('bintrayUsername') || System.getenv('BINTRAY_USERNAME')
|
2017-02-23 04:57:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
def getBintrayApiKey() {
|
2017-04-19 10:48:58 -07:00
|
|
|
return property('bintrayApiKey') || System.getenv('BINTRAY_API_KEY')
|
2017-02-23 04:57:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
def getBintrayGpgPassword() {
|
2017-04-19 10:48:58 -07:00
|
|
|
return property('bintrayGpgPassword') || System.getenv('BINTRAY_GPG_PASSWORD')
|
2017-02-23 04:57:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
def dryRunOnly() {
|
2017-04-19 10:48:58 -07:00
|
|
|
return hasProperty('dryRun') ? property('dryRun').toBoolean() : false
|
2017-02-23 04:57:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
def pomConfig = {
|
|
|
|
licenses {
|
|
|
|
// TODO Can we grab this from above?
|
|
|
|
license {
|
|
|
|
name 'BSD License'
|
|
|
|
url 'https://github.com/facebook/yoga/blob/master/LICENSE'
|
|
|
|
distribution 'repo'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
primaryPublication(MavenPublication) {
|
2017-03-07 03:52:51 -08:00
|
|
|
groupId group
|
|
|
|
artifact(sourcesJar)
|
|
|
|
artifact(javadocJar)
|
|
|
|
pom.packaging='aar'
|
|
|
|
pom.withXml {
|
|
|
|
def root = asNode()
|
|
|
|
root.appendNode('name', 'Yoga')
|
|
|
|
root.appendNode('url', siteURL)
|
|
|
|
root.children().last() + pomConfig
|
|
|
|
def dependenciesNode = root.appendNode('dependencies')
|
|
|
|
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
|
|
|
|
configurations.compile.allDependencies.each {
|
|
|
|
if(it.group != null && (it.name != null || "unspecified".equals(it.name)) && it.version != null) {
|
|
|
|
def dependencyNode = dependenciesNode.appendNode('dependency')
|
|
|
|
dependencyNode.appendNode('groupId', it.group)
|
|
|
|
dependencyNode.appendNode('artifactId', it.name)
|
|
|
|
dependencyNode.appendNode('version', it.version)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-02-23 04:57:18 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bintray {
|
|
|
|
user = getBintrayUsername()
|
|
|
|
key = getBintrayApiKey()
|
|
|
|
publications = ['primaryPublication']
|
|
|
|
configurations = ['archives']
|
|
|
|
pkg {
|
|
|
|
repo = bintrayRepo
|
|
|
|
userOrg = bintrayUserOrg
|
|
|
|
name = project.bintrayName
|
|
|
|
dryRun = dryRunOnly()
|
|
|
|
licenses = projectLicenses
|
|
|
|
override = true
|
|
|
|
publish = true
|
|
|
|
publicDownloadNumbers = true
|
|
|
|
version {
|
|
|
|
name = project.version
|
|
|
|
released = new Date()
|
|
|
|
gpg {
|
|
|
|
sign = true
|
|
|
|
passphrase = getBintrayGpgPassword()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|