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

Ant example source code file (taskcontainer.xml)

This example Ant source code file (taskcontainer.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

as, as, prattle, prattle, seq, seq, unit, unit

The taskcontainer.xml source code

<project default="dont-run-this">

  <property name="build.dir" value="build"/>
  
  <target name="dont-run-this">
    <fail>This build file is supposed to be run by a Unit test
  </target>
 

  <target name="testPropertyExpansion">
    <sequential>
      <property name="foo" value="it worked"/>
      <echo message="As attribute: ${foo}"/>
      <echo>As nested text: ${foo}
    </sequential>
  </target>

  <target name="testTaskdef">
    <mkdir dir="${build.dir}"/>
    <javac srcdir="containersrc" destdir="${build.dir}" debug="on"/>

    <sequential>    
      <taskdef name="sseq" classpath="${build.dir}" classname="test.SpecialSeq"/>
      <sseq>
        <fileset dir="."/>
        <property name="foo" value="it worked"/>
        <echo message="As attribute: ${foo}"/>
        <echo>As nested text: ${foo}
        <nested message="As nested task: ${foo}"/>
      </sseq>
    </sequential>
  </target>

  <target name="testCaseInsensitive">
    <taskdef name="Prattle" classname="org.apache.tools.ant.taskdefs.Echo"/>  
    <taskdef name="Seq"  
             classname="org.apache.tools.ant.taskdefs.Sequential"/>  
    <Prattle>hello  
    <Seq>  
      <Prattle> world  
    </Seq>  
  </target>  

  <target name="cleanup">
    <delete dir="${build.dir}"/>
  </target>
  
</project>

Other Ant examples (source code examples)

Here is a short list of links related to this Ant taskcontainer.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.