OSDN Git Service

Update gradle to 3.1
authorHiroshi Miura <miurahr@linux.com>
Mon, 17 Oct 2016 13:33:40 +0000 (22:33 +0900)
committerHiroshi Miura <miurahr@linux.com>
Mon, 17 Oct 2016 13:33:40 +0000 (22:33 +0900)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
CHANGELOG.md
build.publish.gradle
gradle/wrapper/gradle-wrapper.properties

index e2f6777..25c682c 100644 (file)
@@ -3,8 +3,10 @@ All notable changes to this project will be documented in this file.
 
 ## [Unreleased]
 ### Add
+- Swing dialog for PGP signing passphrase input.
 
 ### Changed
+- Update Gradle version to 3.1
 
 ## [0.8.2] - 2016-10-16
 ### Fixed
@@ -14,12 +16,12 @@ All notable changes to this project will be documented in this file.
 ### Changed
 - Move project URL to https://www.dictzip.org/.
 
-## [0.8.1] - 2015-4-29
+## [0.8.1] - 2016-4-29
 ### Fixed
 - Gradle: github and bintray release error.
 - [#21] fixed unexpected EOFException when readFully() called after seek().
 
-## [0.8.0] - 2015-4-29
+## [0.8.0] - 2016-4-29
 ### Add
 - More javadoc description. Complete for library APIs.
 
index c6ee315..de217eb 100644 (file)
@@ -1,4 +1,5 @@
 apply plugin: 'signing'
+import groovy.swing.SwingBuilder
 
 boolean validProperty(propertyName) {
   try { project.property(propertyName) != null }
@@ -7,10 +8,27 @@ boolean validProperty(propertyName) {
 assert validProperty('signing.keyId'),             'properties for signing must be provided'
 assert validProperty('signing.secretKeyRingFile'), 'properties for signing must be provided'
 
-String askPassword(prompt) {
-  "${System.console().readPassword(prompt)}"
+def keyPass = ''
+if(System.console() == null) {
+    new SwingBuilder().edt {
+        dialog(modal: true, title: 'Enter password', alwaysOnTop: true, resizable: false, locationRelativeTo: null, pack: true, show: true) {
+            vbox { // Put everything below each other
+                label(text: "Please enter passphrase for PGP key ${property('signing.keyId')}:")
+                def input2 = passwordField()
+                button(defaultButton: true, text: 'OK', actionPerformed: {
+                    keyPass = input2.password;
+                    dispose();
+                })
+            }
+        }
+    }
+} else {
+    keyPass = System.console().readPassword("Enter password for PGP key ${property('signing.keyId')}: ")
 }
-ext.'signing.password' = askPassword("Enter password for PGP key ${property('signing.keyId')}: ")
+if (keyPass.size() <= 0) {
+    throw new InvalidUserDataException("You must enter the passwords to proceed.")
+}
+ext.'signing.password' = new String(keyPass)
 
 signing {
   sign configurations.archives
index 3a8d0ff..7929d6d 100644 (file)
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip