polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [3/3] polygene-java git commit: build: reinstate distributions signing
Date Mon, 27 Feb 2017 21:32:44 GMT
build: reinstate distributions signing


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/f29b5041
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/f29b5041
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/f29b5041

Branch: refs/heads/develop
Commit: f29b50411e693de009dea5fa8d3578b64b909a54
Parents: 9001660
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Mon Feb 27 21:52:42 2017 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Mon Feb 27 22:13:48 2017 +0100

----------------------------------------------------------------------
 .../gradle/code/PublishingPlugin.groovy         |  1 +
 .../distributions/DistributionsPlugin.groovy    | 21 ++++++++++++++++++++
 2 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/f29b5041/buildSrc/src/main/groovy/org/apache/polygene/gradle/code/PublishingPlugin.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/code/PublishingPlugin.groovy
b/buildSrc/src/main/groovy/org/apache/polygene/gradle/code/PublishingPlugin.groovy
index cd14487..8f48922 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/code/PublishingPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/code/PublishingPlugin.groovy
@@ -120,6 +120,7 @@ class PublishingPlugin implements Plugin<Project>
     signing.required = config.signed
     signing.sign project.configurations.getByName( 'archives' )
     def signArchives = project.tasks.getByName( 'signArchives' ) as Sign
+    signArchives.enabled = config.signed
     signArchives.onlyIf { !project.findProperty( 'skipSigning' ) }
   }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/f29b5041/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
index f6ad9db..ab62df6 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/distributions/DistributionsPlugin.groovy
@@ -52,6 +52,8 @@ import org.gradle.maven.MavenModule
 import org.gradle.maven.MavenPomArtifact
 import org.gradle.plugins.ide.internal.IdeDependenciesExtractor
 import org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency
+import org.gradle.plugins.signing.Sign
+import org.gradle.plugins.signing.SigningExtension
 
 // TODO Expose all project outputs into configurations
 @CompileStatic
@@ -90,6 +92,7 @@ class DistributionsPlugin implements Plugin<Project>
     applyAssembleDistributions project
     applyCheckDistributions project
     configureDistributionChecksums project
+    configureSigning project
   }
 
   private static void applyAssembleDistributions( Project project )
@@ -428,6 +431,24 @@ class DistributionsPlugin implements Plugin<Project>
     }
   }
 
+  private static void configureSigning( Project project )
+  {
+    def releaseSpec = project.extensions.getByType( ReleaseSpecExtension )
+    project.plugins.apply 'signing'
+    def signing = project.extensions.getByType SigningExtension
+    signing.required = !releaseSpec.developmentVersion
+    def distTasks = [TaskNames.ZIP_SOURCE_DIST, TaskNames.TAR_SOURCE_DIST,
+                     TaskNames.ZIP_BINARY_DIST, TaskNames.TAR_BINARY_DIST]
+                     .collect { taskName -> project.tasks.getByName( taskName ) }
+    distTasks.each { distTask ->
+      distTask.finalizedBy signing.sign( distTask )
+    }
+    project.tasks.withType(Sign) { Sign task ->
+      task.enabled = !releaseSpec.developmentVersion
+      task.onlyIf { !project.findProperty( 'skipSigning' ) }
+    }
+  }
+
   private static void applyStageBinariesMavenRepository( Project project )
   {
     def releaseSpec = project.extensions.getByType ReleaseSpecExtension


Mime
View raw message