I am triggering an ant script (via cruise control), and would like to be able to dump the std out and std err for a particular ant target to a plain text file.
Yes, I am aware that cruise control already does maintain an XML log file containing this information (among many other things), but for portability reasons, I need this to happen from the ant script itself.
Is this possible, and if so, how to do it?
Many thanks!
It's easy:
And you can also say to ant shut up:
It worked fine to me.
The recorder task may be able to do what you want:
Beyond that, certain tasks (exec, java, etc) offer this functionality by themselves (usually by means of
output
anderror
arguments)Try this:
stdouterr.txt
will contain both stdout and stderrstdout.txt
andstderr.txt
will contain stdout and stderr respectivelyFrom my experience, the record task tends to fail when the ant script is run on cruise control, due to file access permissions (if someone can tell me how to fix that I'll be a happy man).
HTH