2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2001-02-13 12:32:01 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2002-02-03 22:11:39 +00:00
|
|
|
<title>FileSet Type</title>
|
2001-02-13 12:32:01 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2><a name="fileset">FileSet</a></h2>
|
2005-03-08 16:37:40 +00:00
|
|
|
<p>A FileSet is a group of files. These files can be found in a
|
2001-02-13 12:32:01 +00:00
|
|
|
directory tree starting in a base directory and are matched by
|
|
|
|
patterns taken from a number of <a
|
2003-02-04 17:29:11 +00:00
|
|
|
href="patternset.html">PatternSets</a> and
|
2005-03-08 16:37:40 +00:00
|
|
|
<a href="selectors.html">Selectors</a>.
|
2001-02-13 12:32:01 +00:00
|
|
|
<p>PatternSets can be specified as nested
|
2001-08-01 09:08:56 +00:00
|
|
|
<code><patternset></code> elements. In addition, FileSet holds
|
|
|
|
an implicit PatternSet and supports the nested
|
|
|
|
<code><include></code>, <code><includesfile></code>,
|
|
|
|
<code><exclude></code> and <code><excludesfile></code>
|
|
|
|
elements of PatternSet directly, as well as PatternSet's
|
|
|
|
attributes.</p>
|
2005-03-08 16:37:40 +00:00
|
|
|
<p>Selectors are available as nested elements within the FileSet.
|
2003-02-04 17:29:11 +00:00
|
|
|
If any of the selectors within the FileSet do not select the file, the
|
2005-03-08 16:37:40 +00:00
|
|
|
file is not considered part of the FileSet. This makes a FileSet
|
2003-04-27 07:38:32 +00:00
|
|
|
equivalent to an <code><and></code> selector container.</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">dir</td>
|
|
|
|
<td valign="top">the root of the directory tree of this FileSet.</td>
|
2016-05-22 16:33:24 +02:00
|
|
|
<td valign="middle" align="center" rowspan="2">Exactly one of dir or file must be specified</td>
|
2003-10-03 04:53:44 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">file</td>
|
2005-03-08 16:37:40 +00:00
|
|
|
<td valign="top">shortcut for specifying a single-file fileset</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">defaultexcludes</td>
|
2001-11-21 16:29:49 +00:00
|
|
|
<td valign="top">indicates whether <a href="../dirtasks.html#defaultexcludes">default excludes</a> should be used or not
|
2001-02-13 12:32:01 +00:00
|
|
|
(<code>yes | no</code>); default excludes are used when omitted.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">includes</td>
|
2002-06-22 23:38:38 +00:00
|
|
|
<td valign="top">comma- or space-separated list of patterns of files that must be
|
2001-02-13 12:32:01 +00:00
|
|
|
included; all files are included when omitted.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">includesfile</td>
|
|
|
|
<td valign="top">the name of a file; each line of this file is
|
2015-03-07 12:32:13 +01:00
|
|
|
taken to be an include pattern.<br/>
|
|
|
|
<b>Note:</b> if the file is empty and there are no other
|
|
|
|
patterns defined for the fileset, all files will be included.
|
|
|
|
</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">excludes</td>
|
2002-06-22 23:38:38 +00:00
|
|
|
<td valign="top">comma- or space-separated list of patterns of files that must be
|
2001-02-13 12:32:01 +00:00
|
|
|
excluded; no files (except default excludes) are excluded when omitted.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">excludesfile</td>
|
|
|
|
<td valign="top">the name of a file; each line of this file is
|
|
|
|
taken to be an exclude pattern.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
2001-09-30 13:21:54 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">casesensitive</td>
|
2003-08-22 14:24:57 +00:00
|
|
|
<td valign="top">Must the include and exclude patterns be treated in a case sensitive way?
|
2001-09-30 13:21:54 +00:00
|
|
|
Defaults to true.</td>
|
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
2002-06-01 12:26:43 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">followsymlinks</td>
|
|
|
|
<td valign="top">Shall symbolic links be followed? Defaults to
|
2002-12-12 14:17:44 +00:00
|
|
|
true. See the note <a href="#symlink">below</a>.</td>
|
2002-06-01 12:26:43 +00:00
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
2007-08-22 08:16:49 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">erroronmissingdir</td>
|
|
|
|
<td valign="top">
|
|
|
|
Specify what happens if the base directory does not exist.
|
|
|
|
If true a build error will happen, if false, the fileset
|
2007-08-22 14:52:22 +00:00
|
|
|
will be ignored/empty.
|
2007-08-22 08:55:18 +00:00
|
|
|
Defaults to true.
|
2010-11-11 17:04:16 +00:00
|
|
|
<em>Since Apache Ant 1.7.1 (default is true for backward compatibility
|
2007-08-22 08:55:18 +00:00
|
|
|
reasons.)</em>
|
|
|
|
</td>
|
2007-08-22 08:16:49 +00:00
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
</table>
|
|
|
|
|
2002-06-01 12:26:43 +00:00
|
|
|
<p><a name="symlink"><b>Note</b></a>: All files/directories for which
|
|
|
|
the canonical path is different from its path are considered symbolic
|
|
|
|
links. On Unix systems this usually means the file really is a
|
2005-03-08 16:37:40 +00:00
|
|
|
symbolic link but it may lead to false results on other
|
2002-06-01 12:26:43 +00:00
|
|
|
platforms.</p>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<h4>Examples</h4>
|
|
|
|
<blockquote><pre>
|
2002-09-04 11:05:19 +00:00
|
|
|
<fileset dir="${server.src}" casesensitive="yes">
|
2002-03-28 23:39:19 +00:00
|
|
|
<include name="**/*.java"/>
|
|
|
|
<exclude name="**/*Test*"/>
|
|
|
|
</fileset>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>Groups all files in directory <code>${server.src}</code> that are Java
|
|
|
|
source files and don't have the text <code>Test</code> in their
|
|
|
|
name.</p>
|
2005-10-14 18:41:07 +00:00
|
|
|
|
2002-03-28 23:39:19 +00:00
|
|
|
<blockquote><pre>
|
2002-09-04 11:05:19 +00:00
|
|
|
<fileset dir="${server.src}" casesensitive="yes">
|
|
|
|
<patternset id="non.test.sources">
|
2001-02-13 12:32:01 +00:00
|
|
|
<include name="**/*.java"/>
|
|
|
|
<exclude name="**/*Test*"/>
|
|
|
|
</patternset>
|
|
|
|
</fileset>
|
|
|
|
</pre></blockquote>
|
2002-03-28 23:39:19 +00:00
|
|
|
<p>Groups the same files as the above example, but also establishes
|
|
|
|
a PatternSet that can be referenced in other
|
|
|
|
<code><fileset></code> elements, rooted at a different directory.</p>
|
2005-10-14 18:41:07 +00:00
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<blockquote><pre>
|
|
|
|
<fileset dir="${client.src}" >
|
|
|
|
<patternset refid="non.test.sources"/>
|
|
|
|
</fileset>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>Groups all files in directory <code>${client.src}</code>, using the
|
2002-03-28 23:39:19 +00:00
|
|
|
same patterns as the above example.</p>
|
2005-10-14 18:41:07 +00:00
|
|
|
|
2003-02-04 17:29:11 +00:00
|
|
|
<blockquote><pre>
|
|
|
|
<fileset dir="${server.src}" casesensitive="yes">
|
|
|
|
<filename name="**/*.java"/>
|
|
|
|
<filename name="**/*Test*" negate="true"/>
|
|
|
|
</fileset>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>Groups the same files as the top example, but using the
|
|
|
|
<code><filename></code> selector.</p>
|
2005-10-14 18:41:07 +00:00
|
|
|
|
2003-02-04 17:29:11 +00:00
|
|
|
<blockquote><pre>
|
|
|
|
<fileset dir="${server.src}" casesensitive="yes">
|
|
|
|
<filename name="**/*.java"/>
|
|
|
|
<not>
|
|
|
|
<filename name="**/*Test*"/>
|
|
|
|
</not>
|
|
|
|
</fileset>
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>Groups the same files as the previous example using a combination of the
|
|
|
|
<code><filename></code> selector and the <code><not></code>
|
|
|
|
selector container.</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
|
2005-10-14 18:41:07 +00:00
|
|
|
<blockquote><pre>
|
|
|
|
<fileset dir="src" includes="main/" />
|
|
|
|
</pre></blockquote>
|
|
|
|
<p>Selects all files in <i>src/main</i> (e.g. <i>src/main/Foo.java</i> or
|
|
|
|
<i>src/main/application/Bar.java</i>).</p>
|
|
|
|
|
2006-09-11 04:33:25 +00:00
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|