Home » Apache Ant Types

Apache Ant Types

Apache Ant provides rich set of types, some of them are given below. We can use these to deal with data, files, path etc and can also be used as service.

Type Description
ClassFileSet It is used to create Jar with all required classes.
DirSet It groups the directories.
FileList A list of files.
FileSet A group of files.
FileMapper It helps to map source and target file.
FilterSet A group of filters.
PatternSet A group of patterns that are referenced by ids.
Selectors A FileSet element, helps to select elements
TarFileSet It is a special form of a FileSet.
ZipFileSet A set of zip files.

ClassFileSet

ClassFileSet is a special type of FileSet which includes all of the class files upon which the root classes are depend. It is used to create JAR with all the required classes for a particular application.

ClassFileSet are declared by the id value which is then used as reference.

DirSet

A DirSet is a group of directories. It supports <patternset> and it’s nested elements <include>, <includesfile>, <exclude>, <excludefiles>. It has various attributes which are given below.

Attribute Description Required
dir It holds root of the directory tree of this DirSet Yes
includes A list of patterns of directories. No
includesfile Name of a file which is to be included. No
excludes A list of patterns of directories that must be excluded. No
excludesfile Name of a file which is to be excluded. No
casesensitive It is used to specify whether case-sensitivity should be applied or not. No
follosymlinks It holds a symbolic link to be followed. No
erroronmissingdir It specifies what happens if the base directory does not exist. No

You may also like