From ddabe439b4745d43a8f5c7a8c4c9278e7fbfec93 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 3 Jul 2017 10:36:05 +0200 Subject: [PATCH] build.gradle: Add hint about obtaining system console with newer Gradle versions and the Gradle daemon. --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index e37ec8ead..c358d9a1c 100644 --- a/build.gradle +++ b/build.gradle @@ -192,6 +192,9 @@ gradle.taskGraph.whenReady { taskGraph -> && taskGraph.allTasks.any { it instanceof Sign }) { // Use Java 6's console to read from the console (no good for a CI environment) def console = System.console() + if (console == null) { + throw new Exception("Could not obtain system console (Console is 'null'). Did you build with gradle daemon? Try the same Gradle command with \"--no-daemon\".") + } console.printf '\n\nWe have to sign some things in this build.\n\nPlease enter your signing details.\n\n' def password = console.readPassword('GnuPG Private Key Password: ')