Make ant quiet without the -q flag?

前端 未结 4 1872
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 08:37

I have an ant buildfile that is often run from vastly different environments. By default, I\'m looking for the same behavior as using:

ant -q
4条回答
  •  囚心锁ツ
    2020-11-29 09:27

    One option might be to set the logging level from within the target.

    You can access loggers by means of a short script task. Something like:

    
        
        ...
    
    

    I'm not familiar with how Eclipse calls Ant, but it might be necessary to iterate over all the build listeners to get 'silence' all round.

    Suggest that how ever you end up doing this, you make it easy to switch back to verbose running.

    Edit - response to comment: You can access project properties from within the script using project.getProperty():

    
    
    

    (Somewhat old) API docs are here, including for the project class.

提交回复
热议问题