如何默认启用AnsiColorLogger Apache Ant内置 logger ,而无需手动运行命令ant -logger org.apache.tools.ant.listener.AnsiColorLogger
或添加环境变量ANT_ARGS
?
我试图从ant build运行命令。
的的build.xml
<exec dir="${sdk.dir}" executable="cmd">
<arg value="${sdk.dir}" />
<arg value="AnsiColorLogger.cmd" />
</exec>
AnsiColorLogger.cmd
START -logger org.apache.tools.ant.listener.AnsiColorLogger
然后我运行ant
命令来编译我的项目,但日志没有着色。
Fuiba@FUIBA D:\DEV\TEST\proj
> ant
Buildfile: D:\DEV\TEST\proj\build.xml
Trying to override old definition of task for
[exec] Microsoft Windows [Versione 10.0.10240]
[exec] (c) 2015 Microsoft Corporation. Tutti i diritti sono riservati.
[exec]
[exec] Fuiba@FUIBA D:\DEV\TEST\proj
[exec] >
相反,当我运行ant -logger org.apache.tools.ant.listener.AnsiColorLogger
时,它就可以了。