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.

uptodate.html 2.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="uptodate">Uptodate</a></h2>
  8. <h3>Description</h3>
  9. <p>Sets a property if a target files are more up to date than a set of
  10. Source files. Source files are specified by nested &lt;srcfiles&gt;
  11. elements, these are <a href="../CoreTypes/fileset.html">FileSet</a>s, while target
  12. files are specified using a nested <a href="../CoreTypes/mapper.html">mapper</a>
  13. element.</p>
  14. <p>The value part of the property being set is <i>true</i> if the
  15. timestamp of the target files is more recent than the timestamp of
  16. every corresponding source file.</p>
  17. <p>The default behavior is to use a <a href="../CoreTypes/mapper.html#merge-mapper">merge
  18. mapper</a> with the <code>to</code> attribute set to the value of the
  19. targetfile attribute.</p>
  20. <p>Normally, this task is used to set properties that are useful to avoid target
  21. execution depending on the relative age of the specified files.</p>
  22. <h3>Parameters</h3>
  23. <table border="1" cellpadding="2" cellspacing="0">
  24. <tr>
  25. <td valign="top"><b>Attribute</b></td>
  26. <td valign="top"><b>Description</b></td>
  27. <td align="center" valign="top"><b>Required</b></td>
  28. </tr>
  29. <tr>
  30. <td valign="top">property</td>
  31. <td valign="top">the name of the property to set.</td>
  32. <td valign="top" align="center">Yes</td>
  33. </tr>
  34. <tr>
  35. <td valign="top">targetfile</td>
  36. <td valign="top">the file for which we want to determine the status.</td>
  37. <td valign="top" align="center">Yes, unless a nested mapper element is
  38. present.</td>
  39. </tr>
  40. </table>
  41. <h3>Examples</h3>
  42. <pre> &lt;uptodate property=&quot;xmlBuild.notRequired&quot; targetfile=&quot;${deploy}\xmlClasses.jar&quot; &gt;
  43. &lt;srcfiles dir= &quot;${src}/xml&quot; includes=&quot;**/*.dtd&quot;/&gt;
  44. &lt;/uptodate&gt;</pre>
  45. <p>sets the property <code><i>xmlBuild.notRequired</i></code> to the value &quot;true&quot;
  46. if the <i>${deploy}/xmlClasses.jar</i> is more up to date than any of the DTD files in the <i>${src}/xml</i> directory.</p>
  47. <p>This can be written as</p>
  48. <pre> &lt;uptodate property=&quot;xmlBuild.notRequired&quot; &gt;
  49. &lt;srcfiles dir= &quot;${src}/xml&quot; includes=&quot;**/*.dtd&quot;/&gt;
  50. &lt;mapper type=&quot;merge&quot; to=&quot;${deploy}\xmlClasses.jar&quot;/&gt;
  51. &lt;/uptodate&gt;</pre>
  52. <p>as well.</p>
  53. <hr>
  54. <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  55. Reserved.</p>
  56. </body>
  57. </html>