Enable colors for logging in terminal for Windows in mintty for Spring Boot.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.gradle/init.d/springColorLogging.gradle Wed Feb 22 10:23:40 2017 +0200
@@ -0,0 +1,12 @@
+gradle.taskGraph.whenReady { graph ->
+ // graph.getAllTasks().findAll().each { println it }
+ def console = System.console() != null
+ if (! console) { console = System.getenv()["TERM"].startsWith("xterm") }
+ if (! console) return
+ graph.getAllTasks().findAll({it.name.equals("bootRun")}).each {
+ it.systemProperties 'spring.output.ansi.enabled': 'always'
+ // it.metaClass.methods*.name.sort().unique().each { println it }
+ };
+ // graph.metaClass.properties.each { println it }
+ // graph.metaClass.methods*.name.sort().unique().each { println it }
+}