Handling Data Using Types

Ant supports a number of types, and the rest of this chapter is devoted to understanding them and how to work with them. These types work much like data types in programming languages, and as you're going to see, types and properties are intertwined. The data structures you create using types can be assigned to properties, and the data you use to set up those data structures is often stored in properties. Now that you've got properties under your belt, it's time to move on to types.

Much of what a build tool like Ant does is work with files in directory structures, so you might expect that many of the Ant types have to do with handling files and directories. You can see the available Ant core (that is, built-in) types in Table 2-7.

Table 2-7. Core Ant types

Type

Description

Assertions

Enables, or disables, Java 1.4 assertions

Description

Holds a description of the project that can be viewed if you use the Ant -projecthelp command

DirSet

Contains a group of directories

FileList

Contains a named list of files

FileSet

Contains a groups of files

File mappers

Maps original filenames to a new set of names

FilterChains

Contains a group of ordered FilterReaders

FilterSet

Contains a group of filters

PatternSet

Contains a group of filename-matching patterns

Path-like structures

Includes a wide variety of support for specifying file paths

Permissions

Contains the security permissions given to the code as executed in the JVM where Ant is currently running

PropertySet

Groups ...

Get Ant: The Definitive Guide, 2nd Edition 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.