Skip to content

Commit e26021a

Browse files
authored
Kotlin DSL - 'maven-central' (#1938) (#1953)
1 parent 8ecd8a1 commit e26021a

File tree

3 files changed

+43
-40
lines changed

3 files changed

+43
-40
lines changed
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
@file:Suppress("UnstableApiUsage")
6+
7+
import org.gradle.api.Project
8+
import org.gradle.api.provider.Property
9+
import org.gradle.api.publish.maven.MavenPom
10+
11+
// --------------- pom configuration ---------------
12+
13+
fun MavenPom.configureMavenCentralMetadata(project: Project) {
14+
name by project.name
15+
description by "Coroutines support libraries for Kotlin"
16+
url by "https://github.com/Kotlin/kotlinx.coroutines"
17+
18+
licenses {
19+
license {
20+
name by "The Apache Software License, Version 2.0"
21+
url by "https://www.apache.org/licenses/LICENSE-2.0.txt"
22+
distribution by "repo"
23+
}
24+
}
25+
26+
developers {
27+
developer {
28+
id by "JetBrains"
29+
name by "JetBrains Team"
30+
organization by "JetBrains"
31+
organizationUrl by "https://www.jetbrains.com"
32+
}
33+
}
34+
35+
scm {
36+
url by "https://github.com/Kotlin/kotlinx.coroutines"
37+
}
38+
}
39+
40+
private infix fun <T> Property<T>.by(value: T) {
41+
set(value)
42+
}

gradle/maven-central.gradle

-37
This file was deleted.

gradle/publish-bintray.gradle

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
apply plugin: 'maven'
88
apply plugin: 'maven-publish'
99

10-
apply from: project.rootProject.file('gradle/maven-central.gradle')
11-
1210
// ------------- tasks
1311

1412
def isMultiplatform = project.name == "kotlinx-coroutines-core"
@@ -64,7 +62,7 @@ publishing {
6462
}
6563

6664
publications.all {
67-
pom.withXml(configureMavenCentralMetadata)
65+
MavenCentralKt.configureMavenCentralMetadata(pom, project)
6866

6967
// add empty javadocs (no need for MPP root publication which publishes only pom file)
7068
if (it.name != 'kotlinMultiplatform' && !isBom) {

0 commit comments

Comments
 (0)