## [Unreleased]
### Add
+- Swing dialog for PGP signing passphrase input.
### Changed
+- Update Gradle version to 3.1
## [0.8.2] - 2016-10-16
### Fixed
### 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.
apply plugin: 'signing'
+import groovy.swing.SwingBuilder
boolean validProperty(propertyName) {
try { project.property(propertyName) != null }
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