Skip to content

Commit

Permalink
Merge pull request #442 from weisJ/fix_pom
Browse files Browse the repository at this point in the history
Fix configuration of pom for published artifacts
  • Loading branch information
steffen-wilke authored Jan 6, 2022
2 parents 337550c + 877c004 commit 03c8407
Showing 1 changed file with 58 additions and 56 deletions.
114 changes: 58 additions & 56 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -161,68 +161,70 @@ allprojects {
}
}

extensions.findByType(PublishingExtension::class)?.apply {
if (project.path == ":") {
// Skip the root project
return@apply
}
plugins.withType<MavenPublishPlugin>().configureEach {
configure<PublishingExtension> {
if (project.path == ":") {
// Skip the root project
return@configure
}

val useInMemoryKey by props()
if (useInMemoryKey) {
apply(plugin = "signing")
val useInMemoryKey by props()
if (useInMemoryKey) {
apply(plugin = "signing")

configure<SigningExtension> {
useInMemoryPgpKeys(
project.stringProperty("signing.inMemoryKey"),
project.stringProperty("signing.password")
)
configure<SigningExtension> {
useInMemoryPgpKeys(
project.stringProperty("signing.inMemoryKey"),
project.stringProperty("signing.password")
)
}
}
}

publications {
withType<MavenPublication> {
// Use the resolved versions in pom.xml
// Gradle might have different resolution rules, so we set the versions
// that were used in Gradle build/test.
versionFromResolution()
pom {
simplifyXml()
description.set(project.description!!)
name.set(
(project.findProperty("artifact.name") as? String)
?: project.name.capitalize().replace("-", " ")
)
url.set("https://litiengine.com")
organization {
name.set("Gurkenlabs")
url.set("https://gurkenlabs.de/")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/gurkenlabs/litiengine/issues")
}
licenses {
license {
name.set("MIT")
url.set("https://github.com/gurkenlabs/litiengine/blob/master/LICENSE")
distribution.set("repo")
publications {
withType<MavenPublication> {
// Use the resolved versions in pom.xml
// Gradle might have different resolution rules, so we set the versions
// that were used in Gradle build/test.
versionFromResolution()
pom {
simplifyXml()
description.set(project.description!!)
name.set(
(project.findProperty("artifact.name") as? String)
?: project.name.capitalize().replace("-", " ")
)
url.set("https://litiengine.com")
organization {
name.set("Gurkenlabs")
url.set("https://gurkenlabs.de/")
}
}
scm {
url.set("'https://github.com/gurkenlabs/litiengine/")
connection.set("scm:git:git://github.com/gurkenlabs/litiengine.git")
developerConnection.set("scm:git:[email protected]:gurkenlabs/litiengine.git")
}
developers {
developer {
id.set("steffen")
name.set("Steffen Wilke")
email.set("[email protected]")
issueManagement {
system.set("GitHub")
url.set("https://github.com/gurkenlabs/litiengine/issues")
}
licenses {
license {
name.set("MIT")
url.set("https://github.com/gurkenlabs/litiengine/blob/master/LICENSE")
distribution.set("repo")
}
}
scm {
url.set("'https://github.com/gurkenlabs/litiengine/")
connection.set("scm:git:git://github.com/gurkenlabs/litiengine.git")
developerConnection.set("scm:git:[email protected]:gurkenlabs/litiengine.git")
}
developer {
id.set("matthias")
name.set("Matthias Wilke")
email.set("[email protected]")
developers {
developer {
id.set("steffen")
name.set("Steffen Wilke")
email.set("[email protected]")
}
developer {
id.set("matthias")
name.set("Matthias Wilke")
email.set("[email protected]")
}
}
}
}
Expand Down

0 comments on commit 03c8407

Please sign in to comment.