Exiting control console from gradle script file to file
I want to log all console output from my gradle script to a log file:
gradle test 2>&1 | tee -a gradle.log
But my gradle script is asking the user for a parameter:
task test << {
System.console().readLine("Enter:").toString()
}
As a result, I have a NullPointerException:
Execution failed for task ':test'. Cannot invoke method readLine() on null object
Can anyone know a solution or workaround for this situation?
+3
source to share