Skip to content

Commit 2358ef5

Browse files
committed
Fix release pipeline
1 parent e0384cc commit 2358ef5

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

convention-plugins/src/main/kotlin/convention.publication.gradle.kts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,25 @@ tasks {
4141
val deleteDokkaOutputDir by registering(Delete::class) {
4242
delete(dokkaOutputDir)
4343
}
44-
45-
register<Jar>("javadocJar") {
46-
dependsOn(deleteDokkaOutputDir, dokkaHtml)
47-
archiveClassifier.set("javadoc")
48-
from(dokkaOutputDir)
49-
}
5044
}
5145

5246
publishing {
5347
// Configure all publications
5448
publications.withType<MavenPublication> {
5549

56-
artifact(tasks.named<Jar>("javadocJar").get())
50+
val publication = this
51+
val dokkaJar = tasks.register<Jar>("${publication.name}DokkaJar") {
52+
group = JavaBasePlugin.DOCUMENTATION_GROUP
53+
description = "Assembles Kotlin docs with Dokka into a Javadoc jar"
54+
archiveClassifier.set("javadoc")
55+
from(tasks.named("dokkaHtml"))
56+
// Each archive name should be distinct, to avoid implicit dependency issues.
57+
// We use the same format as the sources Jar tasks.
58+
// https://youtrack.jetbrains.com/issue/KT-46466
59+
archiveBaseName.set("${archiveBaseName.get()}-${publication.name}")
60+
}
61+
62+
artifact(dokkaJar)
5763

5864
// Provide artifacts information requited by Maven Central
5965
pom {

0 commit comments

Comments
 (0)