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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  5. <title>DependSet Task</title>
  6. </head>
  7. <body>
  8. <h2>DependSet</h2>
  9. A task to manage arbitrary dependencies between resources.
  10. <h3>Description</h3>
  11. <p>
  12. The dependset task compares a set of sources with a set of target
  13. files. If any of the sources has been modified more recently than
  14. any of the target files, all of the target files are removed.
  15. </p>
  16. <p>
  17. Sources and target files are specified via nested
  18. <a href="../CoreTypes/resources.html#collection">Resource Collection</a>s;
  19. sources can be resources of any type, while targets are restricted to files
  20. only. At least one set of sources and one set of targets is required.
  21. </p>
  22. <p>
  23. Use a FileSet when you want to use wildcard include or exclude
  24. patterns and don't care about missing files. Use a FileList when you
  25. want to consider the non-existence of a file as if it were out of
  26. date. If there are any non-existing files in any source or target
  27. FileList, all target files will be removed.
  28. </p>
  29. <p>
  30. DependSet is useful to capture dependencies that are not or cannot be
  31. determined algorithmically. For example, the <code>&lt;style&gt;</code> task only
  32. compares the source XML file and XSLT stylesheet against the target
  33. file to determined whether to restyle the source. Using dependset you
  34. can extend this dependency checking to include a DTD or XSD file as
  35. well as other stylesheets imported by the main stylesheet.
  36. </p>
  37. <h3>Parameters</h3>
  38. <p>
  39. (none)
  40. </p>
  41. <h3>Parameters Specified as Nested Elements</h3>
  42. <h4>sources</h4>
  43. <p>The <code>&lt;sources&gt;</code> element is a
  44. <a href="../CoreTypes/resources.html#union">Union</a> into which
  45. arbitrary resource collections can be nested. <b>Since Ant 1.7</b>
  46. </p>
  47. <h4>srcfileset</h4>
  48. <p>
  49. The nested <code>&lt;srcfileset&gt;</code> element specifies a <a
  50. href="../CoreTypes/fileset.html">FileSet</a>. All files included in
  51. this fileset will be compared against all files included in all of the
  52. <code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
  53. filelists. Multiple <code>&lt;srcfileset&gt;</code> filesets may be specified.
  54. </p>
  55. <h4>srcfilelist</h4>
  56. <p>
  57. The nested <code>&lt;srcfilelist&gt;</code> element specifies a <a
  58. href="../CoreTypes/filelist.html">FileList</a>. All files included in
  59. this filelist will be compared against all files included in all of the
  60. <code>&lt;targetfileset&gt;</code> filesets and <code>&lt;targetfilelist&gt;</code>
  61. filelists. Multiple <code>&lt;srcfilelist&gt;</code> filelists may be specified.
  62. </p>
  63. <h4>targets</h4>
  64. <p>The <code>&lt;targets&gt;</code> element is a
  65. <a href="../using.html#path">Path</a> and thus can
  66. include any filesystem-based resource. <b>Since Ant 1.7</b>
  67. </p>
  68. <h4>targetfileset</h4>
  69. <p>
  70. The nested <code>&lt;targetfileset&gt;</code> element specifies a <a
  71. href="../CoreTypes/fileset.html">FileSet</a>. All files included in
  72. this fileset will be compared against all files included in all of the
  73. <code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
  74. filelists, and if any are older, they are all deleted.
  75. Multiple <code>&lt;targetfileset&gt;</code> filesets may be specified.
  76. </p>
  77. <h4>targetfilelist</h4>
  78. <p>
  79. The nested <code>&lt;targetfilelist&gt;</code> element specifies a <a
  80. href="../CoreTypes/filelist.html">FileList</a>. All files included in
  81. this filelist will be compared against all files included in all of the
  82. <code>&lt;srcfileset&gt;</code> filesets and <code>&lt;sourcefilelist&gt;</code>
  83. filelists, and if any are older, they are all deleted.
  84. Multiple <code>&lt;targetfilelist&gt;</code> filelists may be specified.
  85. </p>
  86. <h3>Examples</h3>
  87. <blockquote> <pre>
  88. &lt;dependset&gt;
  89. &lt;srcfilelist
  90. dir = &quot;${dtd.dir}&quot;
  91. files = &quot;paper.dtd,common.dtd&quot;/&gt;
  92. &lt;srcfilelist
  93. dir = &quot;${xsl.dir}&quot;
  94. files = &quot;common.xsl&quot;/&gt;
  95. &lt;srcfilelist
  96. dir = &quot;${basedir}&quot;
  97. files = &quot;build.xml&quot;/&gt;
  98. &lt;targetfileset
  99. dir = &quot;${output.dir}&quot;
  100. includes = &quot;**/*.html&quot;/&gt;
  101. &lt;/dependset&gt; </pre>
  102. </blockquote>
  103. <p>
  104. In this example derived HTML files in the ${output.dir} directory
  105. will be removed if any are out-of-date with respect to:</p>
  106. <ol>
  107. <li>the DTD of their source XML files</li>
  108. <li>a common DTD (imported by the main DTD)</li>
  109. <li>a subordinate XSLT stylesheet (imported by the main stylesheet), or</li>
  110. <li>the buildfile</li>
  111. </ol>
  112. <p>
  113. If any of the sources in the above example does not exist, all
  114. target files will also be removed. To ignore missing sources instead,
  115. use filesets instead of filelists for the sources.
  116. </p>
  117. <hr>
  118. <p align="center">Copyright &copy; 2001, 2004-2005 The Apache Software Foundation.
  119. All rights
  120. Reserved.</p>
  121. </body>
  122. </html>