I have a script that ask for user input using System.console().readline(‘label’). The label is printed on console and the user can type something.
I upgraded from gradle 2.12 to 2.13 and now the first label I use in the task disappears.
For example, when I run the following:
def console = System.console()
def firstname
def lastname
task run {
doLast {
firstname = console.readLine('> What is your first name?: ')
lastname = console.readLine('> What is your last name?: ')
}
}
I get that with 2.12:
"gradle-2.12/bin/gradle" run
> Building 0% > :run> What is your first name?: John
> What is your last name?: Doe
:run
And that with 2.13:
> "gradle-2.13/bin/gradle" run
> Building 0%> What is your > Building 0% > :runJohn
> What is your last name?: Doe
:run
The first label (> What is your first name?) is not showing.
However, if I change the script with:
def console = System.console()
def firstname
def lastname
task run {
firstname = console.readLine('> What is your first name?: ')
lastname = console.readLine('> What is your last name?: ')
}
(removing the doLast) I get the correct output with both versions.