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.

dependset.html 5.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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>DependSet Task</title>
  20. </head>
  21. <body>
  22. <h2>DependSet</h2>
  23. A task to manage arbitrary dependencies between resources.
  24. <h3>Description</h3>
  25. <p>
  26. The dependset task compares a set of sources with a set of target
  27. files. If any of the sources has been modified more recently than
  28. any of the target files, all of the target files are removed.
  29. </p>
  30. <p>
  31. Sources and target files are specified via nested
  32. <a href="../CoreTypes/resources.html#collection">Resource Collection</a>s;
  33. sources can be resources of any type, while targets are restricted to files
  34. only. At least one set of sources and one set of targets is required.
  35. </p>
  36. <p>
  37. Use a FileSet when you want to use wildcard include or exclude
  38. patterns and don't care about missing files. Use a FileList when you
  39. want to consider the non-existence of a file as if it were out of
  40. date. If there are any non-existing files in any source or target
  41. FileList, all target files will be removed.
  42. </p>
  43. <p>
  44. DependSet is useful to capture dependencies that are not or cannot be
  45. determined algorithmically. For example, the <code>&lt;style&gt;</code> task only
  46. compares the source XML file and XSLT stylesheet against the target
  47. file to determined whether to restyle the source. Using dependset you
  48. can extend this dependency checking to include a DTD or XSD file as
  49. well as other stylesheets imported by the main stylesheet.
  50. </p>
  51. <h3>Parameters</h3>
  52. <table border="1" cellpadding="2" cellspacing="0">
  53. <tr>
  54. <td valign="top"><b>Attribute</b></td>
  55. <td valign="top"><b>Description</b></td>
  56. <td valign="top" align="center"><b>Required</b></td>
  57. </tr>
  58. <tr>
  59. <td valign="top">verbose</td>
  60. <td valign="top">Makes the task list all deleted targets files
  61. and the reason why they get deleted.</td>
  62. <td align="center" valign="top" rowspan="2">No</td>
  63. </tr>
  64. </table>
  65. <h3>Parameters Specified as Nested Elements</h3>
  66. <h4>sources</h4>
  67. <p>The <code>&lt;sources&gt;</code> element is a
  68. <a href="../CoreTypes/resources.html#union">Union</a> into which
  69. arbitrary resource collections can be nested. <b>Since Ant 1.7</b>
  70. </p>
  71. <h4>srcfileset</h4>
  72. <p>
  73. The nested <code>&lt;srcfileset&gt;</code> element specifies a <a
  74. href="../CoreTypes/fileset.html">FileSet</a>. All files included in
  75. this fileset will be compared against all files included in all of the
  76. <code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
  77. filelists. Multiple <code>&lt;srcfileset&gt;</code> filesets may be specified.
  78. </p>
  79. <h4>srcfilelist</h4>
  80. <p>
  81. The nested <code>&lt;srcfilelist&gt;</code> element specifies a <a
  82. href="../CoreTypes/filelist.html">FileList</a>. All files included in
  83. this filelist will be compared against all files included in all of the
  84. <code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
  85. filelists. Multiple <code>&lt;srcfilelist&gt;</code> filelists may be specified.
  86. </p>
  87. <h4>targets</h4>
  88. <p>The <code>&lt;targets&gt;</code> element is a
  89. <a href="../using.html#path">Path</a> and thus can
  90. include any filesystem-based resource. <b>Since Ant 1.7</b>
  91. </p>
  92. <h4>targetfileset</h4>
  93. <p>
  94. The nested <code>&lt;targetfileset&gt;</code> element specifies a <a
  95. href="../CoreTypes/fileset.html">FileSet</a>. All files included in
  96. this fileset will be compared against all files included in all of the
  97. <code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
  98. filelists, and if any are older, they are all deleted.
  99. Multiple <code>&lt;targetfileset&gt;</code> filesets may be specified.
  100. </p>
  101. <h4>targetfilelist</h4>
  102. <p>
  103. The nested <code>&lt;targetfilelist&gt;</code> element specifies a <a
  104. href="../CoreTypes/filelist.html">FileList</a>. All files included in
  105. this filelist will be compared against all files included in all of the
  106. <code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
  107. filelists, and if any are older, they are all deleted.
  108. Multiple <code>&lt;targetfilelist&gt;</code> filelists may be specified.
  109. </p>
  110. <h3>Examples</h3>
  111. <blockquote> <pre>
  112. &lt;dependset&gt;
  113. &lt;srcfilelist
  114. dir = &quot;${dtd.dir}&quot;
  115. files = &quot;paper.dtd,common.dtd&quot;/&gt;
  116. &lt;srcfilelist
  117. dir = &quot;${xsl.dir}&quot;
  118. files = &quot;common.xsl&quot;/&gt;
  119. &lt;srcfilelist
  120. dir = &quot;${basedir}&quot;
  121. files = &quot;build.xml&quot;/&gt;
  122. &lt;targetfileset
  123. dir = &quot;${output.dir}&quot;
  124. includes = &quot;**/*.html&quot;/&gt;
  125. &lt;/dependset&gt; </pre>
  126. </blockquote>
  127. <p>
  128. In this example derived HTML files in the ${output.dir} directory
  129. will be removed if any are out-of-date with respect to:</p>
  130. <ol>
  131. <li>the DTD of their source XML files</li>
  132. <li>a common DTD (imported by the main DTD)</li>
  133. <li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li>
  134. <li>the buildfile</li>
  135. </ol>
  136. <p>
  137. If any of the sources in the above example does not exist, all
  138. target files will also be removed. To ignore missing sources instead,
  139. use filesets instead of filelists for the sources.
  140. </p>
  141. </body>
  142. </html>