From 649f7af27679fb849e00e137936c23c3fcdf4488 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 17 Apr 2014 12:51:54 +0200 Subject: [PATCH] Move gradle signing code out of allprojects because it caused asking for the key passphrase multiple times, i.e. for every subproject. --- build.gradle | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 1dc2ec199..04c29401d 100644 --- a/build.gradle +++ b/build.gradle @@ -34,17 +34,19 @@ allprojects { 'Bundle-Version': version) } - gradle.taskGraph.whenReady { taskGraph -> - if (signingRequired && taskGraph.allTasks.any { it instanceof Sign }) { - // Use Java 6's console to read from the console (no good for a CI environment) - Console console = System.console() - 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: ') +} - allprojects { ext.'signing.password' = password } +gradle.taskGraph.whenReady { taskGraph -> + if (signingRequired + && taskGraph.allTasks.any { it instanceof Sign }) { + // Use Java 6's console to read from the console (no good for a CI environment) + Console console = System.console() + 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: ') - console.printf '\nThanks.\n\n' - } + allprojects { ext.'signing.password' = password } + + console.printf '\nThanks.\n\n' } }