build - Make ant quiet without the -q flag? -


I have an ant buildfile that runs from a very different environment. By default, I am looking at the same behavior:

  ant -q   

However, since some team member's configurations are different, The q option in every person's environment is not easily accomplished in a similar way (some people run ant from eclipse, some are from command line, some are debugging / profiling tools etc. -q < / Em> )

So I silently call myself Ali'm looking for a way to Ant file ...

Some popular following as:

  & lt; Target name = "default" & gt; & Lt; Antocol cool = "yes" target = "build" /> & Lt ;! - does not work - & gt; & Lt; / Target & gt;   

Does anyone think to accomplish something like that? Whenever the default setup is run, no matter what -q is set up, whatever happens, I'm ready to build.

One option may be to set the logging level from within the goal.

You can use loggers through a short script work. Something like this:

  & lt; Goal ... & gt; & Lt; Script language = "javascript" & gt; Var Logger = project.getBuildListeners () .firstElement (); Logger.setMessageOutputLevel (0); & Lt; / Script & gt; ... & lt; / Target & gt;   

How I'm not familiar with eclipse ant calls, but all listeners may be required to re-run to get 'silence' all rounds.

Suggestions How do you end up doing so, you make it easy to switch back to implementing it.

Edit - Reply to Comment: You can use the script using Project Properties project.getProperty () :

  & lt; Property name = "verbose flag" value = "1" /> & Lt; Script language = "javascript" & gt; Var Logger = project.getBuildListeners (). FirstElement (); Var verboseMode = project.getProperty ("verboseFlag") if (! "1" .equals (verboseMode)) logger.setMessageOutputLevel (0); & Lt; / Script & gt;   

(some old), which includes.

Comments