Quantcast
Viewing all articles
Browse latest Browse all 26

Apache Ant – Capture Ant output log using recorder task

There is a <record> task in Ant so you could save the Ant output during the Ant Build. Here is an example.

1. build.xml

<project name="ant-recorder-example" default="record" basedir=".">
  <target name="record">
    <record name="${basedir}/build.log" action="start" append="yes"/>
      <!--
        Whatever ant tasks being executed here,
        the output would be recorded by the recorder
      -->
      <echo message="Hello world"/>
      <echo message="All the above output will be recorded down in the build.log."/>
      <echo message="After the run, check the build.log."/>
    <record name="${basedir}/build.log" action="stop" append="yes"/>
  </target>
</project>

 

2. Run Ant
Image may be NSFW.
Clik here to view.
ant-recorder-example

 

3. Check the build.log
Image may be NSFW.
Clik here to view.
ant-recorder-example-2

 

Done =)

Reference: Ant – Recorder Task


Filed under: Ant Tagged: Ant Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 26

Trending Articles