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 5.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 id="dirset">DirSet</h2>
  23. <p>A DirSet is a group of directories. These directories can be found in a directory tree
  24. starting in a base directory and are matched by patterns taken from a number
  25. of <a href="patternset.html">PatternSets</a> and <a href="selectors.html">Selectors</a>.</p>
  26. <p>PatternSets can be specified as nested <code>&lt;patternset&gt;</code> elements. In
  27. addition, DirSet holds an implicit PatternSet and supports the
  28. nested <code>&lt;include&gt;</code>, <code>&lt;includesfile&gt;</code>, <code>&lt;exclude&gt;</code>
  29. and <code>&lt;excludesfile&gt;</code> elements of <code>&lt;patternset&gt;</code> directly,
  30. as well as <code>&lt;patternset&gt;</code>'s attributes.</p>
  31. <p>Selectors are available as nested elements within the DirSet. If any of the selectors
  32. within the DirSet do not select the directory, it is not considered part of the DirSet. This
  33. makes a DirSet equivalent to an <code>&lt;and&gt;</code> selector container.</p>
  34. <table class="attr">
  35. <tr>
  36. <th scope="col">Attribute</th>
  37. <th scope="col">Description</th>
  38. <th scope="col">Required</th>
  39. </tr>
  40. <tr>
  41. <td>dir</td>
  42. <td>The root of the directory tree of this DirSet.</td>
  43. <td>Yes</td>
  44. </tr>
  45. <tr>
  46. <td>includes</td>
  47. <td>Comma- or space-separated list of patterns of directories that must be included.</td>
  48. <td>No; defaults to all directories</td>
  49. </tr>
  50. <tr>
  51. <td>includesfile</td>
  52. <td>Name of a file; each line of this file is taken to be an include
  53. pattern. <strong>Note:</strong> if the file is empty and there are no other patterns defined
  54. for the fileset, all directories will be included.</td>
  55. <td>No</td>
  56. </tr>
  57. <tr>
  58. <td>excludes</td>
  59. <td>Comma- or space-separated list of patterns of directories that must be excluded.</td>
  60. <td>No; defaults to none</td>
  61. </tr>
  62. <tr>
  63. <td>excludesfile</td>
  64. <td>Name of a file; each line of this file is taken to be an exclude pattern.</td>
  65. <td>No</td>
  66. </tr>
  67. <tr>
  68. <td>casesensitive</td>
  69. <td>Specifies whether case-sensitivity should be applied (<q>true</q>, <q>yes</q>, <q>on</q>
  70. or <q>false</q>, <q>no</q>, <q>off</q>).</td>
  71. <td>No; defaults to <q>true</q></td>
  72. </tr>
  73. <tr>
  74. <td>followsymlinks</td>
  75. <td>Shall symbolic links be followed? See <a href="fileset.html#symlink">fileset's
  76. documentation</a>.</td>
  77. <td>No; defaults to <q>true</q></td>
  78. </tr>
  79. <tr>
  80. <td>erroronmissingdir</td>
  81. <td>Specify what happens if the base directory does not exist. If <q>true</q> a build error
  82. will happen, if <q>false</q>, the dirset will be ignored/empty. <em>Since Apache Ant
  83. 1.7.1</em></td>
  84. <td>No; defaults to true (for backward compatibility reasons)</td>
  85. </tr>
  86. </table>
  87. <h4>Examples</h4>
  88. <pre>
  89. &lt;dirset dir=&quot;${build.dir}&quot;&gt;
  90. &lt;include name=&quot;apps/**/classes&quot;/&gt;
  91. &lt;exclude name=&quot;apps/**/*Test*&quot;/&gt;
  92. &lt;/dirset&gt;
  93. </pre>
  94. <p>Groups all directories named <samp>classes</samp> found under the <samp>apps</samp> subdirectory
  95. of <samp>${build.dir}</samp>, except those that have the text <samp>Test</samp> in their name.</p>
  96. <pre>
  97. &lt;dirset dir=&quot;${build.dir}&quot;&gt;
  98. &lt;patternset id=&quot;non.test.classes&quot;&gt;
  99. &lt;include name=&quot;apps/**/classes&quot;/&gt;
  100. &lt;exclude name=&quot;apps/**/*Test*&quot;/&gt;
  101. &lt;/patternset&gt;
  102. &lt;/dirset&gt;
  103. </pre>
  104. <p>Groups the same directories as the above example, but also establishes a PatternSet that can be
  105. referenced in other <code>&lt;dirset&gt;</code> elements, rooted at a different directory.</p>
  106. <pre>
  107. &lt;dirset dir=&quot;${debug_build.dir}&quot;&gt;
  108. &lt;patternset refid=&quot;non.test.classes&quot;/&gt;
  109. &lt;/dirset&gt;
  110. </pre>
  111. <p>Groups all directories in directory <samp>${debug_build.dir}</samp>, using the same patterns as
  112. the above example.</p>
  113. <pre>
  114. &lt;dirset id=&quot;dirset&quot; dir=&quot;${workingdir}&quot;&gt;
  115. &lt;present targetdir=&quot;${workingdir}&quot;&gt;
  116. &lt;mapper type=&quot;glob&quot; from=&quot;*&quot; to=&quot;*/${markerfile}&quot;/&gt;
  117. &lt;/present&gt;
  118. &lt;/dirset&gt;
  119. </pre>
  120. <p>Selects all directories somewhere under <samp>${workingdir}</samp> which contain
  121. a <samp>${markerfile}</samp>.</p>
  122. </body>
  123. </html>