I\'d like to use AnsiColorLogger to get color ouput from Ant. I\'m using Git Bash on Windows.
I tried:
$ ant -logger org.apache.tools.ant.listener.A
it's probably even easier to just set the environment variable ANT_ARGS. e.g. just put this in your .bashrc:
export ANT_ARGS='-logger org.apache.tools.ant.listener.AnsiColorLogger'
After much Googling and experimentation, I combined several variations into a solution that works well for the particular combination of Git Bash, Ant and Windows.
Relaunch Git Bash after adding the following lines to your .bashrc
file:
alias ant='cant'
function cant {
"ant" -logger org.apache.tools.ant.listener.AnsiColorLogger "$@" \
2>&1 | perl -pe 's/(?<=\e\[)2;//g'
}
Git Bash Noob Tip: .bashrc
file, if it exists, lives in your home directory. Here's how to create/edit it:
$ cd
$ notepad .bashrc &