aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraSemy <897017+aSemy@users.noreply.github.com>2023-03-30 11:00:09 +0200
committerGitHub <noreply@github.com>2023-03-30 11:00:09 +0200
commit2b73ddd36d226e5547398daaf0e4370e48f4bb46 (patch)
tree7ac1305613e4c388430f934c8f690961c79101d0
parente26fc066d524ac81e3495fcf9a3c79f48e827d46 (diff)
downloaddokka-2b73ddd36d226e5547398daaf0e4370e48f4bb46.tar.gz
dokka-2b73ddd36d226e5547398daaf0e4370e48f4bb46.tar.bz2
dokka-2b73ddd36d226e5547398daaf0e4370e48f4bb46.zip
Move POM config to maven-publish convention plugin (#2946)
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts28
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/publication.kt33
-rw-r--r--runners/gradle-plugin/build.gradle.kts7
3 files changed, 29 insertions, 39 deletions
diff --git a/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts b/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts
index 7007fd9e..f4baa3e9 100644
--- a/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts
+++ b/build-logic/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts
@@ -26,5 +26,33 @@ publishing {
publications.withType<MavenPublication>().configureEach {
artifact(javadocJar)
+
+ pom {
+ name.convention(provider { "Dokka ${project.name}" })
+ description.convention("Dokka is an API documentation engine for Kotlin and Java, performing the same function as Javadoc for Java")
+ url.convention("https://github.com/Kotlin/dokka")
+
+ licenses {
+ license {
+ name.convention("The Apache Software License, Version 2.0")
+ url.convention("https://www.apache.org/licenses/LICENSE-2.0.txt")
+ distribution.convention("repo")
+ }
+ }
+
+ developers {
+ developer {
+ id.convention("JetBrains")
+ name.convention("JetBrains Team")
+ organization.convention("JetBrains")
+ organizationUrl.convention("https://www.jetbrains.com")
+ }
+ }
+
+ scm {
+ connection.convention("scm:git:git://github.com/Kotlin/dokka.git")
+ url.convention("https://github.com/Kotlin/dokka/tree/master")
+ }
+ }
}
}
diff --git a/build-logic/src/main/kotlin/org/jetbrains/publication.kt b/build-logic/src/main/kotlin/org/jetbrains/publication.kt
index da8d38d0..3fdc129a 100644
--- a/build-logic/src/main/kotlin/org/jetbrains/publication.kt
+++ b/build-logic/src/main/kotlin/org/jetbrains/publication.kt
@@ -32,11 +32,10 @@ fun Project.registerDokkaArtifactPublication(
when (builder.component) {
DokkaPublicationBuilder.Component.Java -> from(components["java"])
DokkaPublicationBuilder.Component.Shadow -> run {
- extensions.getByType(ShadowExtension::class.java).component(this)
+ extensions.getByType<ShadowExtension>().component(this)
artifact(tasks["sourcesJar"])
}
}
- configurePom("Dokka ${project.name}")
}
}
}
@@ -98,36 +97,6 @@ fun Project.configureSonatypePublicationIfNecessary(vararg publications: String)
}
}
-fun MavenPublication.configurePom(projectName: String) {
- pom {
- name.set(projectName)
- description.set("Dokka is an API documentation engine for Kotlin and Java, performing the same function as Javadoc for Java")
- url.set("https://github.com/Kotlin/dokka")
-
- licenses {
- license {
- name.set("The Apache Software License, Version 2.0")
- url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
- distribution.set("repo")
- }
- }
-
- developers {
- developer {
- id.set("JetBrains")
- name.set("JetBrains Team")
- organization.set("JetBrains")
- organizationUrl.set("https://www.jetbrains.com")
- }
- }
-
- scm {
- connection.set("scm:git:git://github.com/Kotlin/dokka.git")
- url.set("https://github.com/Kotlin/dokka/tree/master")
- }
- }
-}
-
@Suppress("UnstableApiUsage")
private fun Project.signPublicationsIfKeyPresent(vararg publications: String) {
val signingKeyId: String? = System.getenv("SIGN_KEY_ID")
diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts
index afb3c02c..e5d64fe5 100644
--- a/runners/gradle-plugin/build.gradle.kts
+++ b/runners/gradle-plugin/build.gradle.kts
@@ -74,15 +74,8 @@ publishing {
}
register<MavenPublication>("pluginMaven") {
- configurePom("Dokka ${project.name}")
artifactId = "dokka-gradle-plugin"
}
-
- afterEvaluate {
- named<MavenPublication>("dokkaGradlePluginPluginMarkerMaven") {
- configurePom("Dokka plugin")
- }
- }
}
}