1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>FileSet Type</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2><a name="fileset">FileSet</a></h2>
|
---|
28 | <p>A FileSet is a group of files. These files can be found in a
|
---|
29 | directory tree starting in a base directory and are matched by
|
---|
30 | patterns taken from a number of <a
|
---|
31 | href="patternset.html">PatternSets</a> and
|
---|
32 | <a href="selectors.html">Selectors</a>.
|
---|
33 | <p>PatternSets can be specified as nested
|
---|
34 | <code><patternset></code> elements. In addition, FileSet holds
|
---|
35 | an implicit PatternSet and supports the nested
|
---|
36 | <code><include></code>, <code><includesfile></code>,
|
---|
37 | <code><exclude></code> and <code><excludesfile></code>
|
---|
38 | elements of PatternSet directly, as well as PatternSet's
|
---|
39 | attributes.</p>
|
---|
40 | <p>Selectors are available as nested elements within the FileSet.
|
---|
41 | If any of the selectors within the FileSet do not select the file, the
|
---|
42 | file is not considered part of the FileSet. This makes a FileSet
|
---|
43 | equivalent to an <code><and></code> selector container.</p>
|
---|
44 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
45 | <tr>
|
---|
46 | <td valign="top"><b>Attribute</b></td>
|
---|
47 | <td valign="top"><b>Description</b></td>
|
---|
48 | <td align="center" valign="top"><b>Required</b></td>
|
---|
49 | </tr>
|
---|
50 | <tr>
|
---|
51 | <td valign="top">dir</td>
|
---|
52 | <td valign="top">the root of the directory tree of this FileSet.</td>
|
---|
53 | <td valign="middle" align="center" rowspan="2">Either dir or file must be specified</td>
|
---|
54 | </tr>
|
---|
55 | <tr>
|
---|
56 | <td valign="top">file</td>
|
---|
57 | <td valign="top">shortcut for specifying a single-file fileset</td>
|
---|
58 | </tr>
|
---|
59 | <tr>
|
---|
60 | <td valign="top">defaultexcludes</td>
|
---|
61 | <td valign="top">indicates whether <a href="../dirtasks.html#defaultexcludes">default excludes</a> should be used or not
|
---|
62 | (<code>yes | no</code>); default excludes are used when omitted.</td>
|
---|
63 | <td valign="top" align="center">No</td>
|
---|
64 | </tr>
|
---|
65 | <tr>
|
---|
66 | <td valign="top">includes</td>
|
---|
67 | <td valign="top">comma- or space-separated list of patterns of files that must be
|
---|
68 | included; all files are included when omitted.</td>
|
---|
69 | <td valign="top" align="center">No</td>
|
---|
70 | </tr>
|
---|
71 | <tr>
|
---|
72 | <td valign="top">includesfile</td>
|
---|
73 | <td valign="top">the name of a file; each line of this file is
|
---|
74 | taken to be an include pattern.</td>
|
---|
75 | <td valign="top" align="center">No</td>
|
---|
76 | </tr>
|
---|
77 | <tr>
|
---|
78 | <td valign="top">excludes</td>
|
---|
79 | <td valign="top">comma- or space-separated list of patterns of files that must be
|
---|
80 | excluded; no files (except default excludes) are excluded when omitted.</td>
|
---|
81 | <td valign="top" align="center">No</td>
|
---|
82 | </tr>
|
---|
83 | <tr>
|
---|
84 | <td valign="top">excludesfile</td>
|
---|
85 | <td valign="top">the name of a file; each line of this file is
|
---|
86 | taken to be an exclude pattern.</td>
|
---|
87 | <td valign="top" align="center">No</td>
|
---|
88 | </tr>
|
---|
89 | <tr>
|
---|
90 | <td valign="top">casesensitive</td>
|
---|
91 | <td valign="top">Must the include and exclude patterns be treated in a case sensitive way?
|
---|
92 | Defaults to true.</td>
|
---|
93 | <td valign="top" align="center">No</td>
|
---|
94 | </tr>
|
---|
95 | <tr>
|
---|
96 | <td valign="top">followsymlinks</td>
|
---|
97 | <td valign="top">Shall symbolic links be followed? Defaults to
|
---|
98 | true. See the note <a href="#symlink">below</a>.</td>
|
---|
99 | <td valign="top" align="center">No</td>
|
---|
100 | </tr>
|
---|
101 | </table>
|
---|
102 |
|
---|
103 | <p><a name="symlink"><b>Note</b></a>: All files/directories for which
|
---|
104 | the canonical path is different from its path are considered symbolic
|
---|
105 | links. On Unix systems this usually means the file really is a
|
---|
106 | symbolic link but it may lead to false results on other
|
---|
107 | platforms.</p>
|
---|
108 |
|
---|
109 | <h3>Examples</h3>
|
---|
110 | <blockquote><pre>
|
---|
111 | <fileset dir="${server.src}" casesensitive="yes">
|
---|
112 | <include name="**/*.java"/>
|
---|
113 | <exclude name="**/*Test*"/>
|
---|
114 | </fileset>
|
---|
115 | </pre></blockquote>
|
---|
116 | <p>Groups all files in directory <code>${server.src}</code> that are Java
|
---|
117 | source files and don't have the text <code>Test</code> in their
|
---|
118 | name.</p>
|
---|
119 |
|
---|
120 | <blockquote><pre>
|
---|
121 | <fileset dir="${server.src}" casesensitive="yes">
|
---|
122 | <patternset id="non.test.sources">
|
---|
123 | <include name="**/*.java"/>
|
---|
124 | <exclude name="**/*Test*"/>
|
---|
125 | </patternset>
|
---|
126 | </fileset>
|
---|
127 | </pre></blockquote>
|
---|
128 | <p>Groups the same files as the above example, but also establishes
|
---|
129 | a PatternSet that can be referenced in other
|
---|
130 | <code><fileset></code> elements, rooted at a different directory.</p>
|
---|
131 |
|
---|
132 | <blockquote><pre>
|
---|
133 | <fileset dir="${client.src}" >
|
---|
134 | <patternset refid="non.test.sources"/>
|
---|
135 | </fileset>
|
---|
136 | </pre></blockquote>
|
---|
137 | <p>Groups all files in directory <code>${client.src}</code>, using the
|
---|
138 | same patterns as the above example.</p>
|
---|
139 |
|
---|
140 | <blockquote><pre>
|
---|
141 | <fileset dir="${server.src}" casesensitive="yes">
|
---|
142 | <filename name="**/*.java"/>
|
---|
143 | <filename name="**/*Test*" negate="true"/>
|
---|
144 | </fileset>
|
---|
145 | </pre></blockquote>
|
---|
146 | <p>Groups the same files as the top example, but using the
|
---|
147 | <code><filename></code> selector.</p>
|
---|
148 |
|
---|
149 | <blockquote><pre>
|
---|
150 | <fileset dir="${server.src}" casesensitive="yes">
|
---|
151 | <filename name="**/*.java"/>
|
---|
152 | <not>
|
---|
153 | <filename name="**/*Test*"/>
|
---|
154 | </not>
|
---|
155 | </fileset>
|
---|
156 | </pre></blockquote>
|
---|
157 | <p>Groups the same files as the previous example using a combination of the
|
---|
158 | <code><filename></code> selector and the <code><not></code>
|
---|
159 | selector container.</p>
|
---|
160 |
|
---|
161 | <blockquote><pre>
|
---|
162 | <fileset dir="src" includes="main/" />
|
---|
163 | </pre></blockquote>
|
---|
164 | <p>Selects all files in <i>src/main</i> (e.g. <i>src/main/Foo.java</i> or
|
---|
165 | <i>src/main/application/Bar.java</i>).</p>
|
---|
166 |
|
---|
167 |
|
---|
168 |
|
---|
169 | </body>
|
---|
170 | </html>
|
---|
171 |
|
---|