Skip to content

Commit 1df6e44

Browse files
author
Justin Ryan
committed
Use lifecycle to add signing task
1 parent 66332d8 commit 1df6e44

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

‎gradle/maven.gradle‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ subprojects {
33
apply plugin: 'maven' // Java plugin has to have been already applied for the conf2scope mappings to work
44
apply plugin: 'signing'
55

6-
gradle.taskGraph.whenReady { taskGraph ->
7-
if (taskGraph.hasTask("uploadMavenCentral")) {
8-
signing {
9-
required true
10-
sign configurations.archives
11-
}
12-
} else {
13-
task signArchives {
14-
// do nothing
15-
}
6+
if (gradle.startParameter.taskNames.contains("uploadMavenCentral")) {
7+
signing {
8+
required true
9+
sign configurations.archives
10+
}
11+
} else {
12+
task signArchives {
13+
// do nothing
1614
}
1715
}
1816

@@ -21,7 +19,7 @@ subprojects {
2119
*/
2220
task uploadMavenCentral(type:Upload) {
2321
configuration = configurations.archives
24-
dependsOn { 'signArchives' }
22+
dependsOn 'signArchives'
2523
doFirst {
2624
repositories.mavenDeployer {
2725
beforeDeployment { org.gradle.api.artifacts.maven.MavenDeployment deployment -> signing.signPom(deployment) }

0 commit comments

Comments
 (0)