From e2500359f7d157f6f47cc6a62e3d0d12b42d302a Mon Sep 17 00:00:00 2001 From: Ivan Lyutov Date: Wed, 17 Sep 2014 18:38:02 +0300 Subject: [PATCH] KAFKA-1622 - Made signing task to execute only when uploadArchives is called. --- build.gradle | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 74c8c8a..f6e4f8b 100644 --- a/build.gradle +++ b/build.gradle @@ -29,6 +29,10 @@ allprojects { } } +def isVerificationRequired(project) { + project.gradle.startParameter.taskNames.contains("uploadArchives") +} + apply from: file('gradle/license.gradle') apply from: file('scala.gradle') @@ -38,33 +42,37 @@ subprojects { apply plugin: 'maven' apply plugin: 'signing' + licenseTest.onlyIf { isVerificationRequired(project) } + uploadArchives { repositories { signing { - sign configurations.archives - - // To test locally, replace mavenUrl in ~/.gradle/gradle.properties to file://localhost/tmp/myRepo/ - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - repository(url: "${mavenUrl}") { - authentication(userName: "${mavenUsername}", password: "${mavenPassword}") - } - afterEvaluate { - pom.artifactId = "${archivesBaseName}" - pom.project { - name 'Apache Kafka' - packaging 'jar' - url 'http://kafka.apache.org' - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' - } + if (isVerificationRequired(project)) { + sign configurations.archives + + // To test locally, replace mavenUrl in ~/.gradle/gradle.properties to file://localhost/tmp/myRepo/ + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + repository(url: "${mavenUrl}") { + authentication(userName: "${mavenUsername}", password: "${mavenPassword}") + } + afterEvaluate { + pom.artifactId = "${archivesBaseName}" + pom.project { + name 'Apache Kafka' + packaging 'jar' + url 'http://kafka.apache.org' + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + } + } } - } } - } } } } -- 1.9.4.msysgit.0