Skip to content

Commit

Permalink
Disables Gradle console output coloring in interactive mode
Browse files Browse the repository at this point in the history
Using the option `org.gradle.console=plain` to disable all color and other rich output in the Gradle console output.

Closes gh-768
  • Loading branch information
rainboyan committed Nov 28, 2024
1 parent fa11f64 commit 4a1894a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,9 +39,9 @@ import org.grails.cli.profile.ProjectContext
/**
* Utility methods for interacting with Gradle
*
* @since 3.0
* @author Graeme Rocher
* @author Lari Hotari
* @since 3.0
*/
@CompileStatic
class GradleUtil {
Expand Down Expand Up @@ -109,7 +109,7 @@ class GradleUtil {

static LongRunningOperation setupConsoleOutput(ProjectContext context, LongRunningOperation operation) {
GrailsConsole grailsConsole = context.console
operation.colorOutput = grailsConsole.ansiEnabled
operation.colorOutput = System.getProperty('org.gradle.console') != 'plain' ? grailsConsole.ansiEnabled : false
operation.standardOutput = new GrailsConsolePrintStream(grailsConsole.out)
operation.standardError = new GrailsConsoleErrorPrintStream(grailsConsole.err)
operation
Expand Down

0 comments on commit 4a1894a

Please sign in to comment.