You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dirset.html 6.0 kB

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