hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1560971 - in /httpcomponents/project-release-tools/trunk: build.gradle buildSrc/src/main/groovy/PGPSign.groovy
Date Fri, 24 Jan 2014 12:28:43 GMT
Author: olegk
Date: Fri Jan 24 12:28:43 2014
New Revision: 1560971

URL: http://svn.apache.org/r1560971
Log:
Improved GPG passphrase reading from console

Removed:
    httpcomponents/project-release-tools/trunk/buildSrc/src/main/groovy/PGPSign.groovy
Modified:
    httpcomponents/project-release-tools/trunk/build.gradle

Modified: httpcomponents/project-release-tools/trunk/build.gradle
URL: http://svn.apache.org/viewvc/httpcomponents/project-release-tools/trunk/build.gradle?rev=1560971&r1=1560970&r2=1560971&view=diff
==============================================================================
--- httpcomponents/project-release-tools/trunk/build.gradle (original)
+++ httpcomponents/project-release-tools/trunk/build.gradle Fri Jan 24 12:28:43 2014
@@ -77,7 +77,6 @@ File distRelRevisionFile   = new File(pr
 File nextVerFile           = new File(project.buildDir, 'next-ver.txt')
 File nextVerRevisionFile   = new File(project.buildDir, 'next-ver-revision.txt')
 
-
 task prepareRelease(dependsOn: checkoutSnapshot) {
     group = 'Release'
     description = "Prepares release based on development snapshot from ${checkoutSnapshot.repo}."
@@ -326,7 +325,7 @@ if (rcTagFile.exists() && rcRevisionFile
             tar.compression = Compression.GZIP
         }
 
-        task sign(type: PGPSign, dependsOn: checkoutDistStage) {
+        task sign(type: Sign, dependsOn: checkoutDistStage) {
             sign configurations.dist
         }
 
@@ -1003,3 +1002,19 @@ CopySpec siteContent(File dir) {
     }
 }
 
+/////////////////////////// Post-init configuration  ////////////////////////////////////////
+
+def askPassphrase = {
+    String password = project.ext.has('signing.password') ? project.ext.'signing.password'
: null
+    String keyId = project.ext.has('signing.keyId') ? project.ext.'signing.keyId' : null
+    if (keyId && !password) {
+        char[] raw = console.readPassword("\n> Please provide password for PGP key ${keyId}:
")
+        project.ext.'signing.password' = new String(raw)
+    }
+}
+
+gradle.taskGraph.whenReady { TaskExecutionGraph taskGraph ->
+    taskGraph.allTasks.findAll { Task task -> task instanceof Sign }.each { Sign task
->
+        task.doFirst { askPassphrase() }
+    }
+}
\ No newline at end of file



Mime
View raw message