Skip to content

Commit 4a1894a

Browse files
committed
Disables Gradle console output coloring in interactive mode
Using the option `org.gradle.console=plain` to disable all color and other rich output in the Gradle console output. Closes gh-768
1 parent fa11f64 commit 4a1894a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

grace-shell/src/main/groovy/org/grails/cli/gradle/GradleUtil.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,9 +39,9 @@ import org.grails.cli.profile.ProjectContext
3939
/**
4040
* Utility methods for interacting with Gradle
4141
*
42-
* @since 3.0
4342
* @author Graeme Rocher
4443
* @author Lari Hotari
44+
* @since 3.0
4545
*/
4646
@CompileStatic
4747
class GradleUtil {
@@ -109,7 +109,7 @@ class GradleUtil {
109109

110110
static LongRunningOperation setupConsoleOutput(ProjectContext context, LongRunningOperation operation) {
111111
GrailsConsole grailsConsole = context.console
112-
operation.colorOutput = grailsConsole.ansiEnabled
112+
operation.colorOutput = System.getProperty('org.gradle.console') != 'plain' ? grailsConsole.ansiEnabled : false
113113
operation.standardOutput = new GrailsConsolePrintStream(grailsConsole.out)
114114
operation.standardError = new GrailsConsoleErrorPrintStream(grailsConsole.err)
115115
operation

0 commit comments

Comments
 (0)