Common Types and Attributes
All Ant tasks are written using XML — for instance:
<copy file="logo.gif" todir="${builddir}"/>In this example, file and todir
are attributes. The attribute values, "logo.gif"
and "${builddir}", have specific data types. This
section summarizes the allowable data types for task attributes,
followed by a list of attributes common to all tasks.
XML Attribute Conventions
There are many XML attribute listings in this chapter. They take the following form:
- attribute_name (version, type, required_flag)
Is a description of the attribute and its function.
In which:
- attribute_name
Is the name of the attribute. Use this to refer to the attribute when you specify it for a task.
- version
Indicates the version of Ant supporting this attribute.
allmeans Ant Versions 1.2 and later.- type
Indicates the type of data that an attribute can hold. For example,
Stringindicates that an attribute holds textual data. See Table 7-2.- required_flag
Indicates whether a given attribute is required when using the task. If this flag is an asterisk (*), then see the notes immediately following the list.
- Description of attribute
Is a description of the attribute and its function.
Table 7-2 summarizes the attribute types frequently referenced throughout this chapter. In all cases, text from XML attributes is converted into one of the basic types listed here. The “Description” column describes how each conversion happens. The “Implemented by” column lists the Java class that Ant uses to represent each ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access