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