groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [1/2] groovy git commit: fault tolerance if signing properties not set
Date Tue, 10 Jan 2017 22:34:28 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 1d6862712 -> 86065a72b


fault tolerance if signing properties not set


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

Branch: refs/heads/master
Commit: f9a3c0e2443c6e5f8404029193e13ca2e4c87ed2
Parents: 1d68627
Author: paulk <paulk@asert.com.au>
Authored: Tue Jan 10 18:18:50 2017 +1000
Committer: paulk <paulk@asert.com.au>
Committed: Wed Jan 11 08:32:30 2017 +1000

----------------------------------------------------------------------
 gradle/upload.gradle | 48 +++++++++++++++++++++++++++++------------------
 1 file changed, 30 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/f9a3c0e2/gradle/upload.gradle
----------------------------------------------------------------------
diff --git a/gradle/upload.gradle b/gradle/upload.gradle
index 9eaef25..85ca9db 100644
--- a/gradle/upload.gradle
+++ b/gradle/upload.gradle
@@ -46,10 +46,13 @@ allprojects {
     ext.signWithClassifier = { String c, File f ->
         if (rootProject.isReleaseVersion) {
             signing.sign(c, f)
-            project.artifacts.add('archives', new File(f.parent, f.name + '.asc')) {
-                classifier = c
-                type = 'asc'
-                extension = 'jar.asc'
+            def ascFile = new File(f.parent, f.name + '.asc')
+            if (ascFile.exists()) {
+                project.artifacts.add('archives', ascFile) {
+                    classifier = c
+                    type = 'asc'
+                    extension = 'jar.asc'
+                }
             }
         }
     }
@@ -57,11 +60,14 @@ allprojects {
     ext.signArchiveTask = { archiveTask ->
         if (rootProject.isReleaseVersion) {
             signing.sign(archiveTask.classifier, archiveTask.archivePath)
-            project.artifacts.add('archives', new File(archiveTask.destinationDir, archiveTask.archiveName
+ '.asc')) {
-                name = archiveTask.baseName
-                classifier = archiveTask.classifier
-                type = 'asc'
-                extension = archiveTask.extension + '.asc'
+            def ascFile = new File(archiveTask.destinationDir, archiveTask.archiveName +
'.asc')
+            if (ascFile.exists()) {
+                project.artifacts.add('archives', ascFile) {
+                    name = archiveTask.baseName
+                    classifier = archiveTask.classifier
+                    type = 'asc'
+                    extension = archiveTask.extension + '.asc'
+                }
             }
         }
     }
@@ -160,10 +166,13 @@ allprojects {
         // TODO rework these?
         if (isReleaseVersion) {
             signing.sign(distBin.archivePath)
-            project.artifacts.add('archives', new File(distBin.destinationDir, distBin.archiveName
+ '.asc')) {
-                name = 'groovy-binary'
-                type = 'asc'
-                extension = 'zip.asc'
+            def ascFile = new File(distBin.destinationDir, distBin.archiveName + '.asc')
+            if (ascFile.exists()) {
+                project.artifacts.add('archives', ascFile) {
+                    name = 'groovy-binary'
+                    type = 'asc'
+                    extension = 'zip.asc'
+                }
             }
             signing.sign(distSrc.archivePath)
             signing.sign(distDoc.archivePath)
@@ -178,11 +187,14 @@ allprojects {
             }
             if (isReleaseVersion) {
                 signing.sign(t.classifier, t.archivePath)
-                project.artifacts.add('archives', new File(t.destinationDir, t.archiveName
+ '.asc')) {
-                    name = t.baseName
-                    classifier = t.classifier
-                    type = 'asc'
-                    extension = t.extension + '.asc'
+                def ascFile = new File(t.destinationDir, t.archiveName + '.asc')
+                if (ascFile.exists()) {
+                    project.artifacts.add('archives', ascFile) {
+                        name = t.baseName
+                        classifier = t.classifier
+                        type = 'asc'
+                        extension = t.extension + '.asc'
+                    }
                 }
             }
         }


Mime
View raw message