Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I redirect ant exec task output to both a file and stdout?

Tags:

ant

I am using the ant (1.8.2) exec task to start a child process. I need the output of the child process to be shown as part of the normal ant console output, but also be captured in a file.

like image 903
lexicalscope Avatar asked Feb 29 '12 13:02

lexicalscope


1 Answers

You need the redirector

Since Ant 1.6.3 it has an option called alwayslog.

Use it like this:

<exec executable="mycommand">
   <redirector output="myfile.txt" alwayslog="true"/>           
</exec>
like image 125
lexicalscope Avatar answered Nov 08 '22 19:11

lexicalscope