Skip to content

Commit

Permalink
Merge pull request #5315 from bjhargrave/addmavendescriptor
Browse files Browse the repository at this point in the history
build: Use addmavendescriptor gradle plugin to add maven descriptor
  • Loading branch information
bjhargrave committed Jul 13, 2022
2 parents ad8c7c4 + 75d2a50 commit 9c9e6d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
24 changes: 1 addition & 23 deletions gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts
Expand Up @@ -4,6 +4,7 @@ plugins {
groovy
`kotlin-dsl`
id("com.gradle.plugin-publish")
id("dev.hargrave.addmavendescriptor")
}

interface Injected {
Expand Down Expand Up @@ -132,15 +133,6 @@ publishing {
name.set(artifactId)
description.set("The Bnd Gradle plugins.")
}
val publication = this
tasks.register<WriteProperties>("generatePomPropertiesFor${publication.name.capitalize()}Publication") {
description = "Generates the Maven pom.properties file for publication '${publication.name}'."
group = PublishingPlugin.PUBLISH_TASK_GROUP
setOutputFile(layout.buildDirectory.file("publications/${publication.name}/pom-default.properties"))
property("groupId", provider { publication.groupId })
property("artifactId", provider { publication.artifactId })
property("version", provider { publication.version })
}
}
// Configure pom metadata
withType<MavenPublication> {
Expand Down Expand Up @@ -208,20 +200,6 @@ tasks.pluginUnderTestMetadata {
tasks.jar {
// Include dsl SourceSet
from(dsl.get().output)
// META-INF/maven folder
val metaInfMaven = publishing.publications.named<MavenPublication>("pluginMaven").map {
"META-INF/maven/${it.groupId}/${it.artifactId}"
}
// Include generated pom.xml file
into(metaInfMaven) {
from(tasks.named("generatePomFileForPluginMavenPublication"))
rename { "pom.xml" }
}
// Include generated pom.properties file
into(metaInfMaven) {
from(tasks.named("generatePomPropertiesForPluginMavenPublication"))
rename { "pom.properties" }
}
}

tasks.named<Jar>("sourcesJar") {
Expand Down
1 change: 1 addition & 0 deletions gradle-plugins/settings.gradle.kts
@@ -1,6 +1,7 @@
pluginManagement {
plugins {
id("com.gradle.plugin-publish") version "1.0.0"
id("dev.hargrave.addmavendescriptor") version "1.0.0"
}
}

Expand Down

0 comments on commit 9c9e6d5

Please sign in to comment.