From b7c0d808b72352df3a7090ee964bd0ddc58c5866 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 12 Mar 2023 12:58:50 +0300 Subject: [PATCH] Fix dokka publishing --- .../kscience/gradle/internal/publishing.kt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/space/kscience/gradle/internal/publishing.kt b/src/main/kotlin/space/kscience/gradle/internal/publishing.kt index 969bc79..f0d15c3 100644 --- a/src/main/kotlin/space/kscience/gradle/internal/publishing.kt +++ b/src/main/kotlin/space/kscience/gradle/internal/publishing.kt @@ -63,16 +63,8 @@ internal fun Project.setupPublication(mavenPomConfiguration: MavenPom.() -> Unit } } - val dokkaJar by tasks.creating(Jar::class) { - group = "documentation" - archiveClassifier.set("javadoc") - from(tasks.findByName("dokkaHtml")) - } - // Process each publication we have in this project publications.withType { - artifact(dokkaJar) - pom { name.set(project.name) description.set(project.description ?: project.name) @@ -85,6 +77,17 @@ internal fun Project.setupPublication(mavenPomConfiguration: MavenPom.() -> Unit } } + plugins.withId("org.jetbrains.dokka") { + val dokkaJar by tasks.creating(Jar::class) { + group = "documentation" + archiveClassifier.set("javadoc") + from(tasks.findByName("dokkaHtml")) + } + publications.withType { + artifact(dokkaJar) + } + } + if (requestPropertyOrNull("publishing.signing.id") != null || requestPropertyOrNull("signing.gnupg.keyName") != null) { if (!plugins.hasPlugin("signing")) {