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

build: Use addmavendescriptor gradle plugin to add maven descriptor #5315

Merged
merged 1 commit into from Jul 13, 2022
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
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