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

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