Support ANSI color from gradle bootRun

Update the BootRunTask to record the state of the System.console() so
that it can be picked up later by AnsiOutput.

Fixes gh-747
This commit is contained in:
Sylvère Richard
2015-03-26 23:52:46 +01:00
committed by Phillip Webb
parent ba2ea301f1
commit d8308cbf45
4 changed files with 28 additions and 5 deletions

View File

@@ -54,6 +54,10 @@ public class BootRunTask extends JavaExec {
@Override
public void exec() {
if(System.console() != null) {
// Record that the console is available here for AnsiOutput to detect later
this.getEnvironment().put("spring.output.ansi.console-available", true);
}
addResourcesIfNecessary();
super.exec();
}