blob: e58a4203dd70ecba6a71089362c0ad971f6fffc6 [file] [log] [blame]
Roman Elizarov65eff0b2017-12-20 15:51:31 +03001// Configures publishing of Maven artifacts to Bintray
2
3apply plugin: 'maven'
4apply plugin: 'maven-publish'
5apply plugin: 'com.jfrog.bintray'
6
Roman Elizarov2bc0a1b2018-02-01 18:07:32 +01007def platform = platformOf(project)
8def coroutines_core = platformLib("kotlinx-coroutines-core", platform)
9
Roman Elizarov79e02bb2017-12-26 13:08:15 +030010// --------------- pom configuration ---------------
11
12def pomConfig = {
13 licenses {
14 license {
15 name "The Apache Software License, Version 2.0"
16 url "http://www.apache.org/licenses/LICENSE-2.0.txt"
17 distribution "repo"
18 }
19 }
20 developers {
21 developer {
22 id "JetBrains"
23 name "JetBrains Team"
24 organization "JetBrains"
25 organizationUrl "http://www.jetbrains.com"
26 }
27 }
28
29 scm {
30 url "https://github.com/Kotlin/kotlinx.coroutines"
31 }
32}
33
34// ------------- tasks
35
Roman Elizarov2bc0a1b2018-02-01 18:07:32 +010036task sourcesJar(type: Jar) {
Roman Elizarov65eff0b2017-12-20 15:51:31 +030037 classifier = 'sources'
38 from sourceSets.main.allSource
Roman Elizarov2bc0a1b2018-02-01 18:07:32 +010039 if (project.name == coroutines_core && platform != "common") {
40 // add common source, too
41 from rootProject.file("common/$project.name-common/src/main/kotlin")
42 }
Roman Elizarov65eff0b2017-12-20 15:51:31 +030043}
44
45publishing {
46 publications {
47 maven(MavenPublication) {
48 from components.java
49 artifact javadocJar
50 artifact sourcesJar
51 pom.withXml {
52 def root = asNode()
53 root.appendNode('name', project.name)
54 root.appendNode('description', 'Coroutines support libraries for Kotlin')
55 root.appendNode('url', 'https://github.com/Kotlin/kotlinx.coroutines')
56 root.children().last() + pomConfig
57 }
58 }
59 }
60}
61
62bintray {
63 user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
64 key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
65 publications = ['maven']
66 pkg {
67 userOrg = 'kotlin'
68 repo = 'kotlinx'
69 name = 'kotlinx.coroutines'
70 version {
71 name = project.version
72 vcsTag = project.version
73 released = new Date()
74 }
75 }
76}
77
78bintrayUpload.doLast {
79 println("Uploaded $project.name version $project.version")
Roman Elizarov79e02bb2017-12-26 13:08:15 +030080}