No way to off color output in a persistent way


(gstewart) #1

I would like to always turn off color because I can’t read it when it has color. Is there a settings file? I tried setting GRADLE_OPTS

C:\depot\CoreLibs\main>echo %GRADLE_OPTS% --no-color

C:\depot\CoreLibs\main>gradle tasks Unknown option or illegal argument: --no-color. Please check for incorrect spelling or review documentation of startup options.

Could not create the Java virtual machine.

With GRADLE_OPTS unset I can do this

C:\depot\CoreLibs\main>set GRADLE_OPTS=

C:\depot\CoreLibs\main>gradle --no-color show sourceSets.all main sourceSets.all test :show VARS

version:

4.1.2.3

BUILD SUCCESSFUL

Total time: 5.462 secs

using

C:\depot\CoreLibs\main>gradle -version

------------------------------------------------------------ Gradle 1.4 ------------------------------------------------------------

Gradle build time: Monday, January 28, 2013 3:42:46 AM UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.4 compiled on May 22 2012 Ivy: 2.2.0 JVM: 1.6.0_37 (Oracle Corporation R28.2.5-20-152429-1.6.0_37-20120927-1915-windows-x86_64) OS: Windows 7 6.1 amd64


#2

Try as I might, I cannot find any way to configure the ‘–no-color’ setting except as a command-line argument to Gradle. Other startup parameters can be tweaked in your build script, but logging is initialised very early and so misses any changes done in an init script or build script.

This is pretty unfortunate. Ideally, we’d support a system property to allow you to disable the color output.


(gstewart) #3

Ideally I’d like a .gradle file in my home directory where I could set any command line options I want to set persistently. Thank you for checking on this for me


#4

You can do this effectively with an ‘init.gradle’ file in your home directory. Almost every command-line option can be set via this file: unfortunately the --no-color option doesn’t work this way.


(gstewart) #5

Thanks. I’m not how to set this to answered - even if it’s not the answer I wished for.


#6

Thanks Gail. I’ve raised GRADLE-2724 for the specific issue of disabling color output via a persistent setting. The topic is now “acknowledged”.