From 20a64fd51e6b58af47bd7403d23397fceee37690 Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Sat, 6 Apr 2024 21:03:49 +0100 Subject: [PATCH] Fix javadoc and relocation POM publishing (#199) Fix dokka source root. Javadoc generation [started failing](https://github.com/gabrielfeo/develocity-api-kotlin/actions/runs/8576587721) after plugin refactoring. Some ordering change (probably) caused Dokka to no longer detect the source root and just output "Nothing to document". Add repo, developer info to relocation POM (#184) and sign it. Relocation POM failed publishing of 2024.1.0 due to failing these checks. --- library/build.gradle.kts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 58dafbd0..ff84edbc 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -27,7 +27,8 @@ java { } tasks.withType().configureEach { - dokkaSourceSets.all { + dokkaSourceSets.register("main") { + sourceRoot("src/main/kotlin") sourceLink { localDirectory.set(file("src/main/kotlin")) remoteUrl.set(URL("$repoUrl/blob/$version/src/main/kotlin")) @@ -90,7 +91,7 @@ dependencies { integrationTestImplementation("org.jetbrains.kotlinx:kotlin-jupyter-test-kit:0.12.0-181") } -fun libraryPom() = Action { +val libraryPom = Action { name.set("Develocity API Kotlin") description.set("A library to use the Develocity API in Kotlin") url.set(repoUrl) @@ -121,18 +122,18 @@ publishing { create("develocityApiKotlin") { artifactId = "develocity-api-kotlin" from(components["java"]) - pom(libraryPom()) + pom(libraryPom) } // For occasional maven local publishing create("unsignedDevelocityApiKotlin") { artifactId = "develocity-api-kotlin" from(components["java"]) - pom(libraryPom()) + pom(libraryPom) } create("relocation") { + artifactId = "gradle-enterprise-api-kotlin" pom { - groupId = project.group.toString() - artifactId = "gradle-enterprise-api-kotlin" + libraryPom(this) distributionManagement { relocation { groupId = project.group.toString() @@ -164,7 +165,10 @@ publishing { fun isCI() = System.getenv("CI").toBoolean() signing { - sign(publishing.publications["develocityApiKotlin"]) + sign( + publishing.publications["develocityApiKotlin"], + publishing.publications["relocation"], + ) if (isCI()) { useInMemoryPgpKeys( project.properties["signing.secretKey"] as String?,