Skip to content

Commit f9a2878

Browse files
committed
Add MavenCentral metadata to bintray publication as well
1 parent 31f9d02 commit f9a2878

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ publishing {
6262
mavenCentralMetadata()
6363
mavenCentralArtifacts(project, project.sourceSets.main.get().allSource)
6464
}
65+
mavenCentralMetadata()
6566
bintrayRepositoryPublishing(project, user = "kotlin", repo = "kotlinx", name = "binary-compatibility-validator")
6667
}
6768
}

buildSrc/src/MavenCentralMetadata.kt

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,37 @@ package kotlinx.validation.build
77

88
import org.gradle.api.*
99
import org.gradle.api.file.*
10+
import org.gradle.api.publish.*
1011
import org.gradle.api.publish.maven.*
1112
import org.gradle.jvm.tasks.*
1213
import org.gradle.kotlin.dsl.*
1314

14-
fun MavenPublication.mavenCentralMetadata() {
15-
pom {
16-
if (!name.isPresent) {
17-
name.set(artifactId)
18-
}
19-
description.set("Kotlin binary public API management tool")
20-
url.set("https://github.com/Kotlin/binary-compatibility-validator")
21-
licenses {
22-
license {
23-
name.set("The Apache Software License, Version 2.0")
24-
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
25-
distribution.set("repo")
26-
}
27-
}
28-
developers {
29-
developer {
30-
id.set("JetBrains")
31-
name.set("JetBrains Team")
32-
organization.set("JetBrains")
33-
organizationUrl.set("https://www.jetbrains.com")
15+
fun PublishingExtension.mavenCentralMetadata() {
16+
publications.withType(MavenPublication::class) {
17+
pom {
18+
if (!name.isPresent) {
19+
name.set(artifactId)
3420
}
35-
}
36-
scm {
21+
description.set("Kotlin binary public API management tool")
3722
url.set("https://github.com/Kotlin/binary-compatibility-validator")
23+
licenses {
24+
license {
25+
name.set("The Apache Software License, Version 2.0")
26+
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
27+
distribution.set("repo")
28+
}
29+
}
30+
developers {
31+
developer {
32+
id.set("JetBrains")
33+
name.set("JetBrains Team")
34+
organization.set("JetBrains")
35+
organizationUrl.set("https://www.jetbrains.com")
36+
}
37+
}
38+
scm {
39+
url.set("https://github.com/Kotlin/binary-compatibility-validator")
40+
}
3841
}
3942
}
4043
}

0 commit comments

Comments
 (0)