File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
convention-plugins/src/main/kotlin Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff 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
5246publishing {
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 {
You can’t perform that action at this time.
0 commit comments