Debian Codegraph @

manual/Types/dirset.html

raw
1 <!DOCTYPE html>
2 <!--
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
9
10 https://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 -->
18 <html lang="en">
19
20 <head>
21 <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22 <title>DirSet Type</title>
23 </head>
24
25 <body>
26
27 <h2 id="dirset">DirSet</h2>
28 <p>A DirSet is a group of directories. These directories can be found in a directory tree
29 starting in a base directory and are matched by patterns taken from a number
30 of <a href="patternset.html">PatternSets</a> and <a href="selectors.html">Selectors</a>.</p>
31 <p>PatternSets can be specified as nested <code>&lt;patternset&gt;</code> elements. In
32 addition, DirSet holds an implicit PatternSet and supports the
33 nested <code>&lt;include&gt;</code>, <code>&lt;includesfile&gt;</code>, <code>&lt;exclude&gt;</code>
34 and <code>&lt;excludesfile&gt;</code> elements of <code>&lt;patternset&gt;</code> directly,
35 as well as <code>&lt;patternset&gt;</code>'s attributes.</p>
36 <p>Selectors are available as nested elements within the DirSet. If any of the selectors
37 within the DirSet do not select the directory, it is not considered part of the DirSet. This
38 makes a DirSet equivalent to an <code>&lt;and&gt;</code> selector container.</p>
39 <table class="attr">
40 <tr>
41 <th scope="col">Attribute</th>
42 <th scope="col">Description</th>
43 <th scope="col">Required</th>
44 </tr>
45 <tr>
46 <td>dir</td>
47 <td>The root of the directory tree of this DirSet.</td>
48 <td>Yes</td>
49 </tr>
50 <tr>
51 <td>includes</td>
52 <td>Comma- or space-separated list of patterns of directories that must be included.</td>
53 <td>No; defaults to all directories</td>
54 </tr>
55 <tr>
56 <td>includesfile</td>
57 <td>Name of a file; each line of this file is taken to be an include
58 pattern. <strong>Note:</strong> if the file is empty and there are no other patterns defined
59 for the fileset, all directories will be included.</td>
60 <td>No</td>
61 </tr>
62 <tr>
63 <td>excludes</td>
64 <td>Comma- or space-separated list of patterns of directories that must be excluded.</td>
65 <td>No; defaults to none</td>
66 </tr>
67 <tr>
68 <td>excludesfile</td>
69 <td>Name of a file; each line of this file is taken to be an exclude pattern.</td>
70 <td>No</td>
71 </tr>
72 <tr>
73 <td>casesensitive</td>
74 <td>Specifies whether case-sensitivity should be applied (<q>true</q>, <q>yes</q>, <q>on</q>
75 or <q>false</q>, <q>no</q>, <q>off</q>).</td>
76 <td>No; defaults to <q>true</q></td>
77 </tr>
78 <tr>
79 <td>followsymlinks</td>
80 <td>Shall symbolic links and Windows junctions be followed? See <a href="fileset.html#symlink">fileset's
81 documentation</a>. Windows junctions are detected since Ant 1.10.16.</td>
82 <td>No; defaults to <q>true</q></td>
83 </tr>
84 <tr>
85 <td>erroronmissingdir</td>
86 <td>Specify what happens if the base directory does not exist. If <q>true</q> a build error
87 will happen, if <q>false</q>, the dirset will be ignored/empty. <em>Since Apache Ant
88 1.7.1</em></td>
89 <td>No; defaults to true (for backward compatibility reasons)</td>
90 </tr>
91 <tr>
92 <td>refid</td>
93 <td>Makes this <code>dirset</code>
94 a <a href="../using.html#references">reference</a> to
95 a <code>dirset</code> defined elsewhere. If specified no other
96 attributes or nested elements are allowed.</td>
97 <td>No</td>
98 </tr>
99 </table>
100
101 <h4>Examples</h4>
102
103 <pre>
104 &lt;dirset dir=&quot;${build.dir}&quot;&gt;
105 &lt;include name=&quot;apps/**/classes&quot;/&gt;
106 &lt;exclude name=&quot;apps/**/*Test*&quot;/&gt;
107 &lt;/dirset&gt;
108 </pre>
109 <p>Groups all directories named <samp>classes</samp> found under the <samp>apps</samp> subdirectory
110 of <samp>${build.dir}</samp>, except those that have the text <samp>Test</samp> in their name.</p>
111
112 <pre>
113 &lt;dirset dir=&quot;${build.dir}&quot;&gt;
114 &lt;patternset id=&quot;non.test.classes&quot;&gt;
115 &lt;include name=&quot;apps/**/classes&quot;/&gt;
116 &lt;exclude name=&quot;apps/**/*Test*&quot;/&gt;
117 &lt;/patternset&gt;
118 &lt;/dirset&gt;
119 </pre>
120 <p>Groups the same directories as the above example, but also establishes a PatternSet that can be
121 referenced in other <code>&lt;dirset&gt;</code> elements, rooted at a different directory.</p>
122
123 <pre>
124 &lt;dirset dir=&quot;${debug_build.dir}&quot;&gt;
125 &lt;patternset refid=&quot;non.test.classes&quot;/&gt;
126 &lt;/dirset&gt;
127 </pre>
128 <p>Groups all directories in directory <samp>${debug_build.dir}</samp>, using the same patterns as
129 the above example.</p>
130
131 <pre>
132 &lt;dirset id=&quot;dirset&quot; dir=&quot;${workingdir}&quot;&gt;
133 &lt;present targetdir=&quot;${workingdir}&quot;&gt;
134 &lt;mapper type=&quot;glob&quot; from=&quot;*&quot; to=&quot;*/${markerfile}&quot;/&gt;
135 &lt;/present&gt;
136 &lt;/dirset&gt;
137 </pre>
138 <p>Selects all directories somewhere under <samp>${workingdir}</samp> which contain
139 a <samp>${markerfile}</samp>.</p>
140
141 </body>
142 </html>