author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 08 Jan 2021 13:59:23 +0200 | |
changeset 968 | dc543d247f29 |
parent 838 | 98cdbead06be |
permissions | -rw-r--r-- |
837
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
gradle.taskGraph.whenReady { graph -> |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
// graph.getAllTasks().findAll().each { println it } |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
def console = System.console() != null |
838
98cdbead06be
Fix: Cannot invoke method startsWith() on null object.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
837
diff
changeset
|
4 |
def term = System.getenv()["TERM"]; |
98cdbead06be
Fix: Cannot invoke method startsWith() on null object.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
837
diff
changeset
|
5 |
if (! console && term != null) { console = term.startsWith("xterm") } |
837
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
if (! console) return |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
graph.getAllTasks().findAll({it.name.equals("bootRun")}).each { |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
it.systemProperties 'spring.output.ansi.enabled': 'always' |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
// it.metaClass.methods*.name.sort().unique().each { println it } |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
}; |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
// graph.metaClass.properties.each { println it } |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
12 |
// graph.metaClass.methods*.name.sort().unique().each { println it } |
4ba0fe28be27
Enable colors for logging in terminal for Windows in mintty for Spring Boot.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
13 |
} |