开发者

Is it possible to specify logger for ant inside build.xml?

Is it possible specify Ant l开发者_如何转开发istener/logger inside build.xml, not on a command line?


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/

It's also possible to adjust the loglevel inside the buildfile, see :
https://stackoverflow.com/a/5464009/130683
https://stackoverflow.com/a/5479606/130683


It's not in the build file, but you can set the ANT_ARGS env variable to specify the logger

http://wiki.apache.org/ant/TheElementsOfAntStyle


Take a look at the Recorder task. http://ant.apache.org/manual/Tasks/recorder.html


<target name="real-build">
   <exec dir="${basedir}" executable="${ant.command}" failonerror="true">
    <arg line="-f build-all.xml target ${ant.logger}" />
   </exec>
</target>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜