Skip to content

Commit 20a64fd

Browse files
authored
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.
1 parent 61e2822 commit 20a64fd

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

library/build.gradle.kts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ java {
2727
}
2828

2929
tasks.withType<DokkaTask>().configureEach {
30-
dokkaSourceSets.all {
30+
dokkaSourceSets.register("main") {
31+
sourceRoot("src/main/kotlin")
3132
sourceLink {
3233
localDirectory.set(file("src/main/kotlin"))
3334
remoteUrl.set(URL("$repoUrl/blob/$version/src/main/kotlin"))
@@ -90,7 +91,7 @@ dependencies {
9091
integrationTestImplementation("org.jetbrains.kotlinx:kotlin-jupyter-test-kit:0.12.0-181")
9192
}
9293

93-
fun libraryPom() = Action<MavenPom> {
94+
val libraryPom = Action<MavenPom> {
9495
name.set("Develocity API Kotlin")
9596
description.set("A library to use the Develocity API in Kotlin")
9697
url.set(repoUrl)
@@ -121,18 +122,18 @@ publishing {
121122
create<MavenPublication>("develocityApiKotlin") {
122123
artifactId = "develocity-api-kotlin"
123124
from(components["java"])
124-
pom(libraryPom())
125+
pom(libraryPom)
125126
}
126127
// For occasional maven local publishing
127128
create<MavenPublication>("unsignedDevelocityApiKotlin") {
128129
artifactId = "develocity-api-kotlin"
129130
from(components["java"])
130-
pom(libraryPom())
131+
pom(libraryPom)
131132
}
132133
create<MavenPublication>("relocation") {
134+
artifactId = "gradle-enterprise-api-kotlin"
133135
pom {
134-
groupId = project.group.toString()
135-
artifactId = "gradle-enterprise-api-kotlin"
136+
libraryPom(this)
136137
distributionManagement {
137138
relocation {
138139
groupId = project.group.toString()
@@ -164,7 +165,10 @@ publishing {
164165
fun isCI() = System.getenv("CI").toBoolean()
165166

166167
signing {
167-
sign(publishing.publications["develocityApiKotlin"])
168+
sign(
169+
publishing.publications["develocityApiKotlin"],
170+
publishing.publications["relocation"],
171+
)
168172
if (isCI()) {
169173
useInMemoryPgpKeys(
170174
project.properties["signing.secretKey"] as String?,

0 commit comments

Comments
 (0)