blob: e58a4203dd70ecba6a71089362c0ad971f6fffc6 [file] [log] [blame]
// Configures publishing of Maven artifacts to Bintray
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
def platform = platformOf(project)
def coroutines_core = platformLib("kotlinx-coroutines-core", platform)
// --------------- pom configuration ---------------
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "JetBrains"
name "JetBrains Team"
organization "JetBrains"
organizationUrl "http://www.jetbrains.com"
}
}
scm {
url "https://github.com/Kotlin/kotlinx.coroutines"
}
}
// ------------- tasks
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
if (project.name == coroutines_core && platform != "common") {
// add common source, too
from rootProject.file("common/$project.name-common/src/main/kotlin")
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact javadocJar
artifact sourcesJar
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', 'Coroutines support libraries for Kotlin')
root.appendNode('url', 'https://github.com/Kotlin/kotlinx.coroutines')
root.children().last() + pomConfig
}
}
}
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['maven']
pkg {
userOrg = 'kotlin'
repo = 'kotlinx'
name = 'kotlinx.coroutines'
version {
name = project.version
vcsTag = project.version
released = new Date()
}
}
}
bintrayUpload.doLast {
println("Uploaded $project.name version $project.version")
}