<taskdef>

The <taskdef> task is used to make custom tasks available for use within the build file. Basically, you provide the name of the class that will implement this particular custom task and the name that you want to give the custom task. Note that you must give the task a name that is not already the name of an existing task, or the taskdef will not work.

Rather than using multiple taskdefs to set up a number of custom tasks, you can define multiple custom tasks at once by using the file and resource attributes. This is illustrated in the examples that follow. Chapter 6 provides a full custom task example that also demonstrates the use of <taskdef>. Table 4.78 lists the <taskdef> attributes.

Table 4.78. Table of <taskdef> Attributes

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.