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.5 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. <p>
  53. (none)
  54. </p>
  55. <h3>Parameters Specified as Nested Elements</h3>
  56. <h4>sources</h4>
  57. <p>The <code>&lt;sources&gt;</code> element is a
  58. <a href="../CoreTypes/resources.html#union">Union</a> into which
  59. arbitrary resource collections can be nested. <b>Since Ant 1.7</b>
  60. </p>
  61. <h4>srcfileset</h4>
  62. <p>
  63. The nested <code>&lt;srcfileset&gt;</code> element specifies a <a
  64. href="../CoreTypes/fileset.html">FileSet</a>. All files included in
  65. this fileset will be compared against all files included in all of the
  66. <code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
  67. filelists. Multiple <code>&lt;srcfileset&gt;</code> filesets may be specified.
  68. </p>
  69. <h4>srcfilelist</h4>
  70. <p>
  71. The nested <code>&lt;srcfilelist&gt;</code> element specifies a <a
  72. href="../CoreTypes/filelist.html">FileList</a>. All files included in
  73. this filelist will be compared against all files included in all of the
  74. <code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
  75. filelists. Multiple <code>&lt;srcfilelist&gt;</code> filelists may be specified.
  76. </p>
  77. <h4>targets</h4>
  78. <p>The <code>&lt;targets&gt;</code> element is a
  79. <a href="../using.html#path">Path</a> and thus can
  80. include any filesystem-based resource. <b>Since Ant 1.7</b>
  81. </p>
  82. <h4>targetfileset</h4>
  83. <p>
  84. The nested <code>&lt;targetfileset&gt;</code> element specifies a <a
  85. href="../CoreTypes/fileset.html">FileSet</a>. All files included in
  86. this fileset will be compared against all files included in all of the
  87. <code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
  88. filelists, and if any are older, they are all deleted.
  89. Multiple <code>&lt;targetfileset&gt;</code> filesets may be specified.
  90. </p>
  91. <h4>targetfilelist</h4>
  92. <p>
  93. The nested <code>&lt;targetfilelist&gt;</code> element specifies a <a
  94. href="../CoreTypes/filelist.html">FileList</a>. All files included in
  95. this filelist will be compared against all files included in all of the
  96. <code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
  97. filelists, and if any are older, they are all deleted.
  98. Multiple <code>&lt;targetfilelist&gt;</code> filelists may be specified.
  99. </p>
  100. <h3>Examples</h3>
  101. <blockquote> <pre>
  102. &lt;dependset&gt;
  103. &lt;srcfilelist
  104. dir = &quot;${dtd.dir}&quot;
  105. files = &quot;paper.dtd,common.dtd&quot;/&gt;
  106. &lt;srcfilelist
  107. dir = &quot;${xsl.dir}&quot;
  108. files = &quot;common.xsl&quot;/&gt;
  109. &lt;srcfilelist
  110. dir = &quot;${basedir}&quot;
  111. files = &quot;build.xml&quot;/&gt;
  112. &lt;targetfileset
  113. dir = &quot;${output.dir}&quot;
  114. includes = &quot;**/*.html&quot;/&gt;
  115. &lt;/dependset&gt; </pre>
  116. </blockquote>
  117. <p>
  118. In this example derived HTML files in the ${output.dir} directory
  119. will be removed if any are out-of-date with respect to:</p>
  120. <ol>
  121. <li>the DTD of their source XML files</li>
  122. <li>a common DTD (imported by the main DTD)</li>
  123. <li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li>
  124. <li>the buildfile</li>
  125. </ol>
  126. <p>
  127. If any of the sources in the above example does not exist, all
  128. target files will also be removed. To ignore missing sources instead,
  129. use filesets instead of filelists for the sources.
  130. </p>
  131. </body>
  132. </html>