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

Ant example source code file (taskdef.xml)

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

taskcontainer, taskcontainer

The taskdef.xml source code

<?xml version="1.0"?>

<project name="xxx-test" basedir="." default="test1">

  <path id="testclasses">
    <pathelement location="../../../../build/testcases" />
    <pathelement path="${java.class.path}" />
  </path>

  <taskdef name="global"
           classname="org.example.tasks.TaskdefTestContainerTask">
    <classpath refid="testclasses" />
  </taskdef>

  <target name="test1">
    <taskdef/>
  </target>

  <target name="test2">
    <taskdef name=""/>
  </target>

  <target name="test3">
    <taskdef classname=""/>
  </target>

  <target name="test4">
    <taskdef name="" classname="oops"/>
  </target>

  <target name="test5">
    <taskdef name="test" classname="org.apache.tools.ant.Project" />
  </target>

  <target name="test5a">
    <taskdef name="test" classname="org.apache.tools.ant.taskdefs.Copy" />
  </target>

  <target name="test6">
    <taskdef name="test6"
             classname="org.example.tasks.TaskdefTestSimpleTask">
      <classpath refid="testclasses" />
    </taskdef>
    <test6>
      <echo message="worked" />
    </test6>
  </target>

  <target name="test7">
    <taskdef name="test7"
             classname="org.example.tasks.TaskdefTestContainerTask">
      <classpath refid="testclasses" />
    </taskdef>
    <test7>
      <echo message="worked" />
    </test7>
  </target>

  <target name="testGlobal">
    <global>
      <echo message="worked" />
    </global>
  </target>

  <target name="testOverride">
    <taskdef name="copy" classname="org.apache.tools.ant.taskdefs.Echo" />
    <copy>In target
    <sequential>
      <copy>In TaskContainer
    </sequential>
  </target>

</project>

Other Ant examples (source code examples)

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