Capture Ant output

Steve picture Steve · May 10, 2009 · Viewed 12.8k times · Source

Can anyone suggest to me the best way to capture the output from an Ant command?

I'm writing some routing tests for sun spot devices. The command itself returns network statistics. I'm trying to write something which will dump all these results into a more visual application.

I'm on Windows Vista.

Answer

rony l picture rony l · Feb 7, 2011

you could simply use the ant recorder task:

<record name="build.log"> </record>

this has the advantage of having the output written both to the screen and to the log file, which isn't the case when doing output redirection ant debug > build.log or calling ant with the -logfile option.