Created
October 17, 2012 07:55
-
-
Save xconnecting/3904283 to your computer and use it in GitHub Desktop.
Get password console during executing gradle task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task readPassword << { | |
// Get password from user input. | |
def console = System.console() | |
console.writer().write "\n" | |
def password = console.readPassword('%s: ', 'Please enter the password') | |
println password | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment