Show Swing dialog if console not available (for compilation from IDEs).

Based on the code from https://www.timroes.de/2014/01/19/using-password-prompts-with-gradle-build-files/
Merge pull request #4 from AlexJF/master

Show Swing dialog if console not available (for compilation from IDEs).