DirSet

DirSets are groups of directories. These directories can be found in a directory tree starting in a base directory and are matched by patterns taken from a number of PatternSets. DirSets can appear inside tasks that support this feature or at the same level as target (i.e., as children of <project>).

PatternSets can be specified as nested <patternset> elements. In addition, DirSet holds an implicit PatternSet and supports the nested <include>, <includesfile>, <exclude> and <excludesfile> elements of <patternset> directly, as well as <patternset>'s attributes.

Attribute Description Required
dir The root of the directory tree of this DirSet. Yes
includes A comma- or space-separated list of patterns of directories that must be included; all directories are included when omitted. No
includesfile The name of a file; each line of this file is taken to be an include pattern. No
excludes A comma- or space-separated list of patterns of directories that must be excluded; no directories are excluded when omitted. No
excludesfile The name of a file; each line of this file is taken to be an exclude pattern. No
casesensitive Specifies whether case-sensitivty should be applied (true|yes|on or false|no|off). No; defaults to true.
followsymlinks Shall symbolic links be followed? Defaults to true. See fileset's documentation. No

Examples

<dirset dir="${build.dir}">
  <include name="apps/**/classes"/>
  <exclude name="apps/**/*Test*"/>
</dirset>

Groups all directories named classes found under the apps subdirectory of ${build.dir}, except those that have the text Test in their name.

<dirset dir="${build.dir}">
  <patternset id="non.test.classes">
    <include name="apps/**/classes"/>
    <exclude name="apps/**/*Test*"/>
  </patternset>
</dirset>

Groups the same directories as the above example, but also establishes a PatternSet that can be referenced in other <dirset> elements, rooted at a different directory.

<dirset dir="${debug_build.dir}">
  <patternset refid="non.test.classes"/>
</dirset>

Groups all directories in directory ${debug_build.dir}, using the same patterns as the above example.


Copyright © 2002,2004 The Apache Software Foundation. All rights Reserved.