source: release-kits/lirk3/resources/gs3-release-maker/ant/docs/manual/CoreTypes/fileset.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 5.7 KB
Line 
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
13directory tree starting in a base directory and are matched by
14patterns taken from a number of <a
15href="patternset.html">PatternSets</a> and
16<a href="selectors.html">Selectors</a>. FileSets can appear inside tasks
17that 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>&lt;patternset&gt;</code> elements. In addition, FileSet holds
21an implicit PatternSet and supports the nested
22<code>&lt;include&gt;</code>, <code>&lt;includesfile&gt;</code>,
23<code>&lt;exclude&gt;</code> and <code>&lt;excludesfile&gt;</code>
24elements of PatternSet directly, as well as PatternSet's
25attributes.</p>
26<p>Selectors are available as nested elements.within the FileSet.
27If any of the selectors within the FileSet do not select the file, the
28file is not considered part of the FileSet. This makes FileSets
29equivalent to an <code>&lt;and&gt;</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
90the canonical path is different from its path are considered symbolic
91links. On Unix systems this usually means the file really is a
92symbolic links but it may lead to false results on other
93platforms.</p>
94
95<h4>Examples</h4>
96<blockquote><pre>
97&lt;fileset dir=&quot;${server.src}&quot; casesensitive=&quot;yes&quot;&gt;
98 &lt;include name=&quot;**/*.java&quot;/&gt;
99 &lt;exclude name=&quot;**/*Test*&quot;/&gt;
100&lt;/fileset&gt;
101</pre></blockquote>
102<p>Groups all files in directory <code>${server.src}</code> that are Java
103source files and don't have the text <code>Test</code> in their
104name.</p>
105<blockquote><pre>
106&lt;fileset dir=&quot;${server.src}&quot; casesensitive=&quot;yes&quot;&gt;
107 &lt;patternset id=&quot;non.test.sources&quot;&gt;
108 &lt;include name=&quot;**/*.java&quot;/&gt;
109 &lt;exclude name=&quot;**/*Test*&quot;/&gt;
110 &lt;/patternset&gt;
111&lt;/fileset&gt;
112</pre></blockquote>
113<p>Groups the same files as the above example, but also establishes
114a PatternSet that can be referenced in other
115<code>&lt;fileset&gt;</code> elements, rooted at a different directory.</p>
116<blockquote><pre>
117&lt;fileset dir=&quot;${client.src}&quot; &gt;
118 &lt;patternset refid=&quot;non.test.sources&quot;/&gt;
119&lt;/fileset&gt;
120</pre></blockquote>
121<p>Groups all files in directory <code>${client.src}</code>, using the
122same patterns as the above example.</p>
123<blockquote><pre>
124&lt;fileset dir=&quot;${server.src}&quot; casesensitive=&quot;yes&quot;&gt;
125 &lt;filename name=&quot;**/*.java&quot;/&gt;
126 &lt;filename name=&quot;**/*Test*&quot; negate=&quot;true&quot;/&gt;
127&lt;/fileset&gt;
128</pre></blockquote>
129<p>Groups the same files as the top example, but using the
130<code>&lt;filename&gt;</code> selector.</p>
131<blockquote><pre>
132&lt;fileset dir=&quot;${server.src}&quot; casesensitive=&quot;yes&quot;&gt;
133 &lt;filename name=&quot;**/*.java&quot;/&gt;
134 &lt;not&gt;
135 &lt;filename name=&quot;**/*Test*&quot;/&gt;
136 &lt;/not&gt;
137&lt;/fileset&gt;
138</pre></blockquote>
139<p>Groups the same files as the previous example using a combination of the
140<code>&lt;filename&gt;</code> selector and the <code>&lt;not&gt;</code>
141selector container.</p>
142
143<hr>
144<p align="center">Copyright &copy; 2000-2004 The Apache Software Foundation.
145All rights Reserved.</p>
146
147</body>
148</html>
149
Note: See TracBrowser for help on using the repository browser.