Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move POM config to maven-publish convention plugin #2946

Merged
merged 1 commit into from Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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")
}
}
}
}
33 changes: 1 addition & 32 deletions build-logic/src/main/kotlin/org/jetbrains/publication.kt
Expand Up @@ -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}")
}
}
}
Expand Down Expand Up @@ -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")
Expand Down
7 changes: 0 additions & 7 deletions runners/gradle-plugin/build.gradle.kts
Expand Up @@ -74,15 +74,8 @@ publishing {
}

register<MavenPublication>("pluginMaven") {
configurePom("Dokka ${project.name}")
artifactId = "dokka-gradle-plugin"
}

afterEvaluate {
named<MavenPublication>("dokkaGradlePluginPluginMarkerMaven") {
configurePom("Dokka plugin")
}
}
}
}

Expand Down