alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Ant example source code file (recorder.xml)

This example Ant source code file (recorder.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Ant tags/keywords

The recorder.xml source code

<?xml version="1.0"?>
<project name="recorder-test" default="all" basedir=".">

    <property name="recin" location="recorder"/>
    <property name="recdir" location="recorder-out"/>

    <target name="all" depends="noappend,append,restart,deleterestart"/>

    <target name="prepare">
      <mkdir dir="${recdir}"/>
    </target>

    <target name="noappend">
        <copy file="${recin}/rectest2.result" tofile="${recdir}/rectest1.log"/>
        <record name="${recdir}/rectest1.log" action="start" />
        <echo message="some message1"/>
        <record name="${recdir}/rectest1.log" action="stop" />
    </target>

    <target name="append">
        <copy file="${recin}/rectest1.result" tofile="${recdir}/rectest2.log"/>
        <record name="${recdir}/rectest2.log" append="true" action="start"/>
        <echo message="some message2"/>
        <record name="${recdir}/rectest2.log" action="stop"/>
    </target>

    <target name="restart">
        <record name="${recdir}/rectest3.log" action="start"/>
        <echo message="some message1"/>
        <record name="${recdir}/rectest3.log" action="stop"/>
        <echo message="some message2"/>
        <record name="${recdir}/rectest3.log" action="start"/>
        <echo message="some message3"/>
        <record name="${recdir}/rectest3.log" action="stop"/>
    </target>

    <target name="deleterestart">
        <record name="${recdir}/rectest4.log" action="start"/>
        <echo message="some message1"/>
        <record name="${recdir}/rectest4.log" action="stop"/>
        <delete file="${recdir}/rectest4.log"/>
        <echo message="some message2"/>
        <record name="${recdir}/rectest4.log" action="start"/>
        <echo message="some message3"/>
        <record name="${recdir}/rectest4.log" action="stop"/>
    </target>


    <target name="cleanup">
       <delete dir="${recdir}"/>
    </target>

</project>

Other Ant examples (source code examples)

Here is a short list of links related to this Ant recorder.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.