是否可以在 build.xml 中为 ant 指定记录器? [英] Is it possible to specify logger for ant inside build.xml?
问题描述
是否可以在 build.xml<中指定 Ant listener/logger/code>,不是在命令行上?
Is it possible specify Ant listener/logger inside build.xml
, not on a command line?
推荐答案
在构建文件中,可以使用 ant api 并通过 scriptdef
创建内部任务.
即用 groovy 实现:
Within the buildfile it's possible to make use of the ant api and create an internal task via scriptdef
.
i.e. implemented with groovy:
http://josefbetancourt.wordpress.com/2011/08/18/buildlistener-groovy-scriptdef/http://octodecillion.com/blog/buildlistener-groovy-scriptdef/
也可以在构建文件中调整日志级别,见:
https://stackoverflow.com/a/5464009/130683
https://stackoverflow.com/a/5479606/130683
It's also possible to adjust the loglevel inside the buildfile, see :
https://stackoverflow.com/a/5464009/130683
https://stackoverflow.com/a/5479606/130683
这篇关于是否可以在 build.xml 中为 ant 指定记录器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!