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.

multirootfileset.html 6.3 KiB

10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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>MultiRootFileSet Type</title>
  20. </head>
  21. <body>
  22. <h2><a name="multirootfileset">MultiRootFileSet</a></h2>
  23. <p><em>Since Ant 1.9.4</em></p>
  24. <p>A MultiRootFileSet is a group of files or directories. These files
  25. or directories can be found in a directory forrest starting with a set
  26. of base directories and are matched by patterns taken from a number of
  27. <a href="patternset.html">PatternSets</a> and <a
  28. href="selectors.html">Selectors</a>.</p>
  29. <p>MultiRootFileSet acts as a union of <a
  30. href="fileset.html">FileSets</a> and <a href="dirset.html">DirSets</a>
  31. that share the same patterns and selectors.</p>
  32. <p>MultiRootFileSet supports all attributes and nested elements of
  33. FileSet and DirSet except for the "dir" attribute.</p>
  34. <table border="1" cellpadding="2" cellspacing="0">
  35. <tr>
  36. <td valign="top"><b>Attribute</b></td>
  37. <td valign="top"><b>Description</b></td>
  38. <td align="center" valign="top"><b>Required</b></td>
  39. </tr>
  40. <tr>
  41. <td valign="top">basedirs</td>
  42. <td valign="top">Comma separated list of directories that build
  43. the roots of the MultiRootFileSet.</td>
  44. <td valign="top" align="center">No</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">cache</td>
  48. <td valign="top">Whether to cache results; disabling
  49. may seriously impact performance</td>
  50. <td valign="top" align="center">No, default <i>true</i></td>
  51. </tr>
  52. <tr>
  53. <td valign="top">type</td>
  54. <td valign="top">The type of file system entities which will be
  55. included in this set.
  56. Acceptable values are:
  57. <ul>
  58. <li>file - regular files</li>
  59. <li>dir - directories</li>
  60. <li>both - regular files and directories</li>
  61. </ul>
  62. </td>
  63. <td valign="top" align="center">No, defaults to <i>file</i></td>
  64. </tr>
  65. <tr>
  66. <td valign="top">includes</td>
  67. <td valign="top">A comma- or space-separated list of patterns of directories that
  68. must be included; all directories 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">A comma- or space-separated list of patterns of directories that
  80. must be excluded; no directories 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">Specifies whether case-sensitivity should be applied
  92. (<code>true</code>|<code>yes</code>|<code>on</code> or
  93. <code>false</code>|<code>no</code>|<code>off</code>).</td>
  94. <td valign="top" align="center">No; defaults to true.</td>
  95. </tr>
  96. <tr>
  97. <td valign="top">followsymlinks</td>
  98. <td valign="top">Shall symbolic links be followed? Defaults to
  99. true. See <a href="fileset.html#symlink">fileset's documentation</a>.</td>
  100. <td valign="top" align="center">No</td>
  101. </tr>
  102. <tr>
  103. <td valign="top">erroronmissingdir</td>
  104. <td valign="top">
  105. Specify what happens if one of the base directories does not exist.
  106. If true a build error will happen, if false, the subtree
  107. will be ignored/empty.
  108. Defaults to true.
  109. </td>
  110. <td valign="top" align="center">No</td>
  111. </tr>
  112. </table>
  113. <h3>Parameters specified as nested elements</h3>
  114. <p>PatternSets can be specified as nested
  115. <code>&lt;patternset&gt;</code> elements. In addition, MultiRootFileSet holds
  116. an implicit PatternSet and supports the nested
  117. <code>&lt;include&gt;</code>, <code>&lt;includesfile&gt;</code>,
  118. <code>&lt;exclude&gt;</code> and <code>&lt;excludesfile&gt;</code>
  119. elements of <code>&lt;patternset&gt;</code> directly, as well as
  120. <code>&lt;patternset&gt;</code>'s attributes.</p>
  121. <p>Selectors are available as nested elements within the
  122. MultiRootFileSet. If any of the selectors within the MultiRootFileSet
  123. do not select the file or directory, it is not considered part of the
  124. MultiRootFileSet. This makes a MultiRootFileSet equivalent to
  125. an <code>&lt;and&gt;</code> selector container.</p>
  126. <p>In addition basedirs for the MultiRootFileSet can be specified as
  127. nested <code>basedir</code> elements that have a
  128. single <code>file</code> attribute.</p>
  129. <h4>Examples</h4>
  130. <blockquote><pre>
  131. &lt;multirootfileset basedirs=&quot;${build.dir},${other.project.dir}&quot;&gt;
  132. &lt;include name=&quot;apps/**/classes&quot;/&gt;
  133. &lt;exclude name=&quot;apps/**/*Test*&quot;/&gt;
  134. &lt;/multirootfileset&gt;
  135. </pre></blockquote>
  136. <p>Groups all files inside <code>classes</code> found under the
  137. <code>apps</code> subdirectory of <code>${build.dir}</code> or
  138. <code>${other.project.dir}</code>, except those that have the text
  139. <code>Test</code> in their name.</p>
  140. <blockquote><pre>
  141. &lt;multirootfileset&gt;
  142. &lt;basedir file=&quot;${build.dir}&quot;/&gt;
  143. &lt;basedir file=&quot;${other.project.dir}&quot;
  144. &lt;include name=&quot;apps/**/classes&quot;/&gt;
  145. &lt;exclude name=&quot;apps/**/*Test*&quot;/&gt;
  146. &lt;/multirootfileset&gt;
  147. </pre></blockquote>
  148. <p>Is equivalent to the first example but used
  149. nested <code>basedir</code> elements. The nested elements and
  150. the <code>basedirs</code> attribute can be used at the same time and
  151. the will be merged.</p>
  152. </body>
  153. </html>