Skip to content

Commit 23b94e4

Browse files
committed
Improve Gradle build scripts
Closes gh-820
1 parent 941c887 commit 23b94e4

File tree

3 files changed

+13
-51
lines changed

3 files changed

+13
-51
lines changed

build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ subprojects { project ->
138138
ext.isTestSuite = project.name.startsWith("grace-test-suite")
139139
ext.isCiBuild = project.hasProperty("isCiBuild") || System.getenv().get("CI") as Boolean
140140
ext.pomInfo = {
141-
if (project.name != 'grace-gradle-plugin') {
141+
if (project.name == 'grace-gradle-plugin') {
142+
delegate.name "Grace Gradle Plugin"
143+
delegate.description "Grace Framework : A Gradle plugin for Grace which provides a bunch of useful plugins"
144+
}
145+
else {
142146
def projectName = project.name.split('-')*.capitalize().join(' ')
143147
delegate.name projectName
144148
delegate.description "Grace Framework : $projectName"
@@ -223,11 +227,9 @@ subprojects { project ->
223227
}
224228

225229
afterEvaluate {
226-
if (project.name != 'grace-gradle-plugin') {
227-
signing {
228-
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
229-
sign publishing.publications.maven
230-
}
230+
signing {
231+
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
232+
sign publishing.publications.maven
231233
}
232234
}
233235

grace-gradle-plugin/build.gradle

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ dependencies {
4949
}
5050

5151
gradlePlugin {
52+
automatedPublishing = false
53+
5254
plugins {
5355
graceCore {
5456
displayName = "Grace Core Gradle Plugin"
@@ -127,38 +129,6 @@ tasks.withType(Copy) {
127129
}
128130
}
129131

130-
if (isReleaseVersion) {
131-
afterEvaluate {
132-
signing {
133-
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
134-
Publication[] publications = new Publication[publishing.publications.size()]
135-
publishing.publications.findAll().toArray(publications)
136-
sign(publications)
137-
}
138-
}
139-
140-
tasks.withType(Sign) {
141-
onlyIf { isReleaseVersion }
142-
}
143-
}
144-
145132
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
146133
shouldRunAfter(tasks.withType(Sign))
147134
}
148-
149-
publishing {
150-
publications {
151-
pluginMaven(MavenPublication) {
152-
pom {
153-
name = "Grace Gradle Plugin"
154-
description = "A Gradle plugin for Grace which provides a bunch of useful plugins"
155-
156-
withXml {
157-
def xml = asNode()
158-
159-
xml.children().last() + pomInfo
160-
}
161-
}
162-
}
163-
}
164-
}

gradle/assemble.gradle

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,10 @@ task install(dependsOn: populateDependencies) { task ->
126126
task publishToDist { task ->
127127
subprojects { Project project ->
128128
if (!project.name.startsWith('grace-test-suite') && !project.name.startsWith('grace-dependencies') && !project.name.startsWith('grace-bom')) {
129-
if (project.name == 'grace-gradle-plugin') {
130-
project.tasks.named("generateMetadataFileForIvyPublication").configure {
131-
enabled = false
132-
}
133-
project.tasks.named("generateMetadataFileForPluginIvyPublication").configure {
134-
enabled = false
135-
}
136-
task.dependsOn("$project.name:publishAllPublicationsToGraceDistRepository")
137-
} else {
138-
project.tasks.named("generateMetadataFileForIvyPublication").configure {
139-
enabled = false
140-
}
141-
task.dependsOn("$project.name:publishAllPublicationsToGraceDistRepository")
129+
project.tasks.named("generateMetadataFileForIvyPublication").configure {
130+
enabled = false
142131
}
132+
task.dependsOn("$project.name:publishAllPublicationsToGraceDistRepository")
143133
}
144134
}
145135
}

0 commit comments

Comments
 (0)