From 1df6e445488edfec78512c70e4db7352a1df57ec Mon Sep 17 00:00:00 2001 From: Justin Ryan Date: Mon, 9 Apr 2012 17:04:28 -0700 Subject: [PATCH] Use lifecycle to add signing task --- gradle/maven.gradle | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/gradle/maven.gradle b/gradle/maven.gradle index 1673a24f8..560e66b4d 100644 --- a/gradle/maven.gradle +++ b/gradle/maven.gradle @@ -3,16 +3,14 @@ subprojects { apply plugin: 'maven' // Java plugin has to have been already applied for the conf2scope mappings to work apply plugin: 'signing' - gradle.taskGraph.whenReady { taskGraph -> - if (taskGraph.hasTask("uploadMavenCentral")) { - signing { - required true - sign configurations.archives - } - } else { - task signArchives { - // do nothing - } + if (gradle.startParameter.taskNames.contains("uploadMavenCentral")) { + signing { + required true + sign configurations.archives + } + } else { + task signArchives { + // do nothing } } @@ -21,7 +19,7 @@ subprojects { */ task uploadMavenCentral(type:Upload) { configuration = configurations.archives - dependsOn { 'signArchives' } + dependsOn 'signArchives' doFirst { repositories.mavenDeployer { beforeDeployment { org.gradle.api.artifacts.maven.MavenDeployment deployment -> signing.signPom(deployment) }