2020-06-10 00:08:19 -07:00
|
|
|
import cash.z.ecc.android.Deps
|
|
|
|
|
|
|
|
/////////////////////////////////////////
|
|
|
|
// Publishing
|
|
|
|
/////////////////////////////////////////
|
|
|
|
|
|
|
|
group = Deps.group
|
|
|
|
version = Deps.versionName
|
|
|
|
|
|
|
|
// Create the pom configuration:
|
|
|
|
def pomConfig = {
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name "MIT-style"
|
|
|
|
url "http://opensource.org/licenses/MIT"
|
|
|
|
distribution "repo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id "gmale"
|
|
|
|
name "Kevin Gorham"
|
|
|
|
email "kevin.gorham@z.cash"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
scm {
|
|
|
|
url Deps.githubUrl
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Jar containing Kotlin sources
|
|
|
|
task sourcesJar(type: Jar) {
|
|
|
|
archiveClassifier = 'sources'
|
|
|
|
from kotlin.sourceSets.main.kotlin.srcDirs
|
|
|
|
}
|
|
|
|
|
|
|
|
// Jar containing docs
|
|
|
|
task docsJar(type: Jar) {
|
|
|
|
archiveClassifier = "javadoc"
|
|
|
|
group = JavaBasePlugin.DOCUMENTATION_GROUP
|
|
|
|
dependsOn dokka
|
|
|
|
from dokka
|
|
|
|
}
|
|
|
|
|
2020-06-11 12:33:10 -07:00
|
|
|
def activePublication = Deps.publishingTarget
|
2020-06-10 00:08:19 -07:00
|
|
|
publishing {
|
|
|
|
publications {
|
2020-06-10 02:59:40 -07:00
|
|
|
android.libraryVariants.all { variant ->
|
|
|
|
if (variant.name != activePublication.variant) return
|
2020-06-10 00:08:19 -07:00
|
|
|
|
2020-06-10 02:59:40 -07:00
|
|
|
Production(MavenPublication) {
|
|
|
|
artifact variant.outputs[0].packageLibrary // the AAR
|
|
|
|
artifact sourcesJar
|
|
|
|
artifact docsJar
|
|
|
|
groupId Deps.group
|
|
|
|
artifactId activePublication.artifactId
|
|
|
|
version Deps.versionName
|
|
|
|
|
|
|
|
pom.withXml {
|
|
|
|
def root = asNode()
|
|
|
|
root.appendNode('description', Deps.description)
|
|
|
|
root.appendNode('name', activePublication.artifactId)
|
|
|
|
root.appendNode('url', )
|
|
|
|
root.children().last() + pomConfig
|
|
|
|
|
|
|
|
// AAR-specific: we must explicitly add dependencies for an AAR
|
|
|
|
def depsNode = root["dependencies"][0] ?: root.appendNode("dependencies")
|
|
|
|
def addDep = {
|
|
|
|
if (it.group == null) return // Avoid empty dependency nodes
|
|
|
|
def dependencyNode = depsNode.appendNode('dependency')
|
|
|
|
dependencyNode.appendNode('groupId', it.group)
|
|
|
|
dependencyNode.appendNode('artifactId', it.name)
|
|
|
|
dependencyNode.appendNode('version', it.version)
|
2020-09-25 06:56:45 -07:00
|
|
|
if (it.hasProperty('type')) {
|
|
|
|
dependencyNode.appendNode('type', it.type)
|
|
|
|
}
|
|
|
|
if (it.hasProperty('scope')) {
|
|
|
|
dependencyNode.appendNode('scope', it.scope)
|
|
|
|
}
|
2020-06-10 02:59:40 -07:00
|
|
|
if (it.hasProperty('optional') && it.optional) {
|
|
|
|
dependencyNode.appendNode('optional', 'true')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// run the 'addDep' closure over each dependency
|
2020-09-25 06:56:45 -07:00
|
|
|
configurations.implementation.allDependencies.each addDep
|
2020-06-10 02:59:40 -07:00
|
|
|
}
|
2020-06-10 00:08:19 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bintray {
|
2020-08-13 18:08:41 -07:00
|
|
|
user = project.findProperty('bintrayUser') ?: System.getenv('BINTRAY_USER')
|
|
|
|
key = project.findProperty('bintrayApiKey') ?: System.getenv('BINTRAY_API_KEY')
|
2020-06-10 00:08:19 -07:00
|
|
|
publications = ['Production']
|
|
|
|
override = true
|
|
|
|
pkg {
|
|
|
|
repo = 'android'
|
2020-06-10 02:59:40 -07:00
|
|
|
name = activePublication.artifactId
|
2020-06-10 00:08:19 -07:00
|
|
|
description = Deps.description
|
|
|
|
publish = true
|
|
|
|
publicDownloadNumbers = true
|
|
|
|
userOrg = 'ecc-mobile'
|
2020-09-25 06:56:45 -07:00
|
|
|
labels = ['aar', 'native', 'android', 'zcash', 'ecc', 'sdk', 'kotlin', 'mobile', 'electric coin company', 'open source', 'crypto', 'cryptocurrency', 'cryptography', 'privacy']
|
2020-06-10 00:08:19 -07:00
|
|
|
licenses = ['MIT']
|
|
|
|
vcsUrl = Deps.githubUrl
|
2020-06-11 12:33:10 -07:00
|
|
|
dryRun = Deps.publishingDryRun
|
2020-06-10 00:08:19 -07:00
|
|
|
version {
|
|
|
|
name = Deps.versionName
|
|
|
|
desc = Deps.description
|
|
|
|
released = new Date()
|
|
|
|
vcsTag = this.version
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|