Skip to content

Instantly share code, notes, and snippets.

@xconnecting
Created October 17, 2012 07:55
Show Gist options
  • Save xconnecting/3904283 to your computer and use it in GitHub Desktop.
Save xconnecting/3904283 to your computer and use it in GitHub Desktop.
Get password console during executing gradle task
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