1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>FileSet Type</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="fileset">FileSet</a></h2>
|
---|
12 | <p>FileSets are groups of files. These files can be found in a
|
---|
13 | directory tree starting in a base directory and are matched by
|
---|
14 | patterns taken from a number of <a
|
---|
15 | href="patternset.html">PatternSets</a> and
|
---|
16 | <a href="selectors.html">Selectors</a>. FileSets can appear inside tasks
|
---|
17 | that support this feature or at the same level as <code>target</code>
|
---|
18 | - i.e., as children of <code>project</code>.</p>
|
---|
19 | <p>PatternSets can be specified as nested
|
---|
20 | <code><patternset></code> elements. In addition, FileSet holds
|
---|
21 | an implicit PatternSet and supports the nested
|
---|
22 | <code><include></code>, <code><includesfile></code>,
|
---|
23 | <code><exclude></code> and <code><excludesfile></code>
|
---|
24 | elements of PatternSet directly, as well as PatternSet's
|
---|
25 | attributes.</p>
|
---|
26 | <p>Selectors are available as nested elements.within the FileSet.
|
---|
27 | If any of the selectors within the FileSet do not select the file, the
|
---|
28 | file is not considered part of the FileSet. This makes FileSets
|
---|
29 | equivalent to an <code><and></code> selector container.</p>
|
---|
30 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
31 | <tr>
|
---|
32 | <td valign="top"><b>Attribute</b></td>
|
---|
33 | <td valign="top"><b>Description</b></td>
|
---|
34 | <td align="center" valign="top"><b>Required</b></td>
|
---|
35 | </tr>
|
---|
36 | <tr>
|
---|
37 | <td valign="top">dir</td>
|
---|
38 | <td valign="top">the root of the directory tree of this FileSet.</td>
|
---|
39 | <td valign="middle" align="center" rowspan="2">Either dir or file must be specified</td>
|
---|
40 | </tr>
|
---|
41 | <tr>
|
---|
42 | <td valign="top">file</td>
|
---|
43 | <td valign="top">shortcut for specifying a single file fileset</td>
|
---|
44 | </tr>
|
---|
45 | <tr>
|
---|
46 | <td valign="top">defaultexcludes</td>
|
---|
47 | <td valign="top">indicates whether <a href="../dirtasks.html#defaultexcludes">default excludes</a> should be used or not
|
---|
48 | (<code>yes | no</code>); default excludes are used when omitted.</td>
|
---|
49 | <td valign="top" align="center">No</td>
|
---|
50 | </tr>
|
---|
51 | <tr>
|
---|
52 | <td valign="top">includes</td>
|
---|
53 | <td valign="top">comma- or space-separated list of patterns of files that must be
|
---|
54 | included; all files are included when omitted.</td>
|
---|
55 | <td valign="top" align="center">No</td>
|
---|
56 | </tr>
|
---|
57 | <tr>
|
---|
58 | <td valign="top">includesfile</td>
|
---|
59 | <td valign="top">the name of a file; each line of this file is
|
---|
60 | taken to be an include pattern.</td>
|
---|
61 | <td valign="top" align="center">No</td>
|
---|
62 | </tr>
|
---|
63 | <tr>
|
---|
64 | <td valign="top">excludes</td>
|
---|
65 | <td valign="top">comma- or space-separated list of patterns of files that must be
|
---|
66 | excluded; no files (except default excludes) are excluded when omitted.</td>
|
---|
67 | <td valign="top" align="center">No</td>
|
---|
68 | </tr>
|
---|
69 | <tr>
|
---|
70 | <td valign="top">excludesfile</td>
|
---|
71 | <td valign="top">the name of a file; each line of this file is
|
---|
72 | taken to be an exclude pattern.</td>
|
---|
73 | <td valign="top" align="center">No</td>
|
---|
74 | </tr>
|
---|
75 | <tr>
|
---|
76 | <td valign="top">casesensitive</td>
|
---|
77 | <td valign="top">Must the include and exclude patterns be treated in a case sensitive way?
|
---|
78 | Defaults to true.</td>
|
---|
79 | <td valign="top" align="center">No</td>
|
---|
80 | </tr>
|
---|
81 | <tr>
|
---|
82 | <td valign="top">followsymlinks</td>
|
---|
83 | <td valign="top">Shall symbolic links be followed? Defaults to
|
---|
84 | true. See the note <a href="#symlink">below</a>.</td>
|
---|
85 | <td valign="top" align="center">No</td>
|
---|
86 | </tr>
|
---|
87 | </table>
|
---|
88 |
|
---|
89 | <p><a name="symlink"><b>Note</b></a>: All files/directories for which
|
---|
90 | the canonical path is different from its path are considered symbolic
|
---|
91 | links. On Unix systems this usually means the file really is a
|
---|
92 | symbolic links but it may lead to false results on other
|
---|
93 | platforms.</p>
|
---|
94 |
|
---|
95 | <h4>Examples</h4>
|
---|
96 | <blockquote><pre>
|
---|
97 | <fileset dir="${server.src}" casesensitive="yes">
|
---|
98 | <include name="**/*.java"/>
|
---|
99 | <exclude name="**/*Test*"/>
|
---|
100 | </fileset>
|
---|
101 | </pre></blockquote>
|
---|
102 | <p>Groups all files in directory <code>${server.src}</code> that are Java
|
---|
103 | source files and don't have the text <code>Test</code> in their
|
---|
104 | name.</p>
|
---|
105 | <blockquote><pre>
|
---|
106 | <fileset dir="${server.src}" casesensitive="yes">
|
---|
107 | <patternset id="non.test.sources">
|
---|
108 | <include name="**/*.java"/>
|
---|
109 | <exclude name="**/*Test*"/>
|
---|
110 | </patternset>
|
---|
111 | </fileset>
|
---|
112 | </pre></blockquote>
|
---|
113 | <p>Groups the same files as the above example, but also establishes
|
---|
114 | a PatternSet that can be referenced in other
|
---|
115 | <code><fileset></code> elements, rooted at a different directory.</p>
|
---|
116 | <blockquote><pre>
|
---|
117 | <fileset dir="${client.src}" >
|
---|
118 | <patternset refid="non.test.sources"/>
|
---|
119 | </fileset>
|
---|
120 | </pre></blockquote>
|
---|
121 | <p>Groups all files in directory <code>${client.src}</code>, using the
|
---|
122 | same patterns as the above example.</p>
|
---|
123 | <blockquote><pre>
|
---|
124 | <fileset dir="${server.src}" casesensitive="yes">
|
---|
125 | <filename name="**/*.java"/>
|
---|
126 | <filename name="**/*Test*" negate="true"/>
|
---|
127 | </fileset>
|
---|
128 | </pre></blockquote>
|
---|
129 | <p>Groups the same files as the top example, but using the
|
---|
130 | <code><filename></code> selector.</p>
|
---|
131 | <blockquote><pre>
|
---|
132 | <fileset dir="${server.src}" casesensitive="yes">
|
---|
133 | <filename name="**/*.java"/>
|
---|
134 | <not>
|
---|
135 | <filename name="**/*Test*"/>
|
---|
136 | </not>
|
---|
137 | </fileset>
|
---|
138 | </pre></blockquote>
|
---|
139 | <p>Groups the same files as the previous example using a combination of the
|
---|
140 | <code><filename></code> selector and the <code><not></code>
|
---|
141 | selector container.</p>
|
---|
142 |
|
---|
143 | <hr>
|
---|
144 | <p align="center">Copyright © 2000-2004 The Apache Software Foundation.
|
---|
145 | All rights Reserved.</p>
|
---|
146 |
|
---|
147 | </body>
|
---|
148 | </html>
|
---|
149 |
|
---|