Skip to content

Commit

Permalink
Apply publishing conventions to kotest-bom (#4073)
Browse files Browse the repository at this point in the history
apply the publishing convention plugin in kotest-bom

- update publishing-convention to only adds a Javadoc JAR for KMP
subprojects
- remove duplicated configuration in kotest-bom
  • Loading branch information
aSemy committed Jun 9, 2024
1 parent f1def7c commit ca5c340
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ publishing {
}

publications.withType<MavenPublication>().configureEach {
artifact(javadocJar)

pom {
name.set("Kotest")
description.set("Kotlin Test Framework")
Expand Down Expand Up @@ -81,6 +79,10 @@ publishing {
}

pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
publishing.publications.withType<MavenPublication>().configureEach {
artifact(javadocJar)
}

publishPlatformArtifactsInRootModule(project)
}

Expand Down
60 changes: 1 addition & 59 deletions kotest-bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
plugins {
`java-platform`
`maven-publish`
signing
id("kotest-publishing-conventions")
}

group = "io.kotest"
version = Ci.publishVersion

val bomProject = project

// Explicitly exclude subprojects that will never be published so that when configuring this project
Expand Down Expand Up @@ -44,64 +40,10 @@ dependencies {
}
}

val ossrhUsername: String by project
val ossrhPassword: String by project
val signingKey: String? by project
val signingPassword: String? by project

publishing {
repositories {
maven {
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
name = "deploy"
url = if (Ci.isRelease) releasesRepoUrl else snapshotsRepoUrl
credentials {
username = System.getenv("OSSRH_USERNAME") ?: ossrhUsername
password = System.getenv("OSSRH_PASSWORD") ?: ossrhPassword
}
}
}

publications {
create<MavenPublication>("KotestBom") {
from(components["javaPlatform"])
pom {
name.set("Kotest")
description.set("Kotlin Test Framework")
url.set("https://github.com/kotest/kotest")

scm {
connection.set("scm:git:https://github.com/kotest/kotest/")
developerConnection.set("scm:git:https://github.com/sksamuel/")
url.set("https://github.com/kotest/kotest/")
}

licenses {
license {
name.set("Apache-2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}

developers {
developer {
id.set("sksamuel")
name.set("Stephen Samuel")
email.set("sam@sksamuel.com")
}
}
}
}
}
}

signing {
useGpgCmd()
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
}
if (Ci.isRelease) {
sign(publishing.publications)
}
}

0 comments on commit ca5c340

Please sign in to comment.