Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions gradle-plugins/biz.aQute.bnd.gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ configurations {
val dslImplementation by existing {
extendsFrom(implementation.get())
}
val dslRuntimeOnly by existing {
val dslRuntimeOnly by existing {
extendsFrom(runtimeOnly.get())
}
}
Expand Down Expand Up @@ -169,6 +169,15 @@ publishing {
}
}
}
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 })
}
}
}
}
Expand Down Expand Up @@ -201,17 +210,26 @@ tasks.withType<Javadoc> {
}

tasks.pluginUnderTestMetadata {
// Include dsl SourceSet
// Include dsl SourceSet
pluginClasspath.from(sourceSets["dsl"].output)
}

tasks.jar {
// Include dsl SourceSet
from(sourceSets["dsl"].output)
// Include generated pom file
into(archiveBaseName.map { "META-INF/maven/${project.group}/${it}" }) {
// 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")
rename { "pom.xml" }
}
// Include generated pom.properties file
into(metaInfMaven) {
from(tasks.named("generatePomPropertiesForPluginMavenPublication"))
rename { "pom.properties" }
}
}

Expand Down