diff --git a/build.gradle b/build.gradle index ff1f0ea68b..46852fdd17 100644 --- a/build.gradle +++ b/build.gradle @@ -138,11 +138,7 @@ subprojects { project -> ext.isTestSuite = project.name.startsWith("grace-test-suite") ext.isCiBuild = project.hasProperty("isCiBuild") || System.getenv().get("CI") as Boolean ext.pomInfo = { - if (project.name == 'grace-gradle-plugin') { - delegate.name "Grace Gradle Plugin" - delegate.description "Grace Framework : A Gradle plugin for Grace which provides a bunch of useful plugins" - } - else { + if (project.name != 'grace-gradle-plugin') { def projectName = project.name.split('-')*.capitalize().join(' ') delegate.name projectName delegate.description "Grace Framework : $projectName" diff --git a/grace-gradle-plugin/build.gradle b/grace-gradle-plugin/build.gradle index 0c4f1e9cc9..a89f852b8a 100644 --- a/grace-gradle-plugin/build.gradle +++ b/grace-gradle-plugin/build.gradle @@ -130,3 +130,38 @@ tasks.withType(Copy) { tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach { shouldRunAfter(tasks.withType(Sign)) } + +if (isReleaseVersion) { + afterEvaluate { + signing { + required { isReleaseVersion && gradle.taskGraph.hasTask("publish") } + Publication[] publications = new Publication[publishing.publications.size()] + publishing.publications.findAll().toArray(publications) + sign(publications) + } + } + + tasks.withType(Sign) { + onlyIf { isReleaseVersion } + } +} + +project.afterEvaluate { + project.publishing.publications.each { publication-> + if (publication instanceof MavenPublication) { + publication.pom { + if (publication.name == "maven" || publication.name == "pluginMaven") { + name = "Grace Gradle Plugin" + description = "Grace Framework : A Gradle plugin for Grace which provides a bunch of useful plugins" + } + + if (publication.name == "pluginMaven" || publication.name.endsWith("PluginMarkerMaven")) { + withXml { + def xml = asNode() + xml.children().last() + pomInfo + } + } + } + } + } +} \ No newline at end of file