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.

sync.html 3.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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>Sync Task</title>
  6. </head>
  7. <body>
  8. <h2><a name="get">Sync</a></h2>
  9. <p><em>Since Ant 1.6</em></p>
  10. <h3>Description</h3>
  11. <p>Synchronize a target directory from the files defined in one or
  12. more filesets.</p>
  13. <h3>Parameters</h3>
  14. <table border="1" cellpadding="2" cellspacing="0">
  15. <tr>
  16. <td valign="top"><b>Attribute</b></td>
  17. <td valign="top"><b>Description</b></td>
  18. <td align="center" valign="top"><b>Required</b></td>
  19. </tr>
  20. <tr>
  21. <td valign="top">todir</td>
  22. <td valign="top">the target directory to sync with the filesets</td>
  23. <td align="center" valign="top">Yes</td>
  24. </tr>
  25. <tr>
  26. <td valign="top">overwrite</td>
  27. <td valign="top">Overwrite existing files even if the destination
  28. files are newer.</td>
  29. <td valign="top" align="center">No; defaults to false.</td>
  30. </tr>
  31. <tr>
  32. <td valign="top">includeEmptyDirs</td>
  33. <td valign="top">Copy any empty directories included in the FileSet(s).
  34. </td>
  35. <td valign="top" align="center">No; defaults to true.</td>
  36. </tr>
  37. <tr>
  38. <td valign="top">failonerror</td>
  39. <td valign="top">Log a warning message, but do not stop the build,
  40. when one of the nested filesets points to a directory that
  41. doesn't exist.
  42. </td>
  43. <td valign="top" align="center">No; defaults to true.</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">verbose</td>
  47. <td valign="top">Log the files that are being copied.</td>
  48. <td valign="top" align="center">No; defaults to false.</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">granularity</td>
  52. <td valign="top">The number of milliseconds leeway to give before
  53. deciding a file is out of date. This is needed because not every
  54. file system supports tracking the last modified time to the
  55. millisecond level. Default is 0 milliseconds, or 2 seconds on DOS
  56. systems. This can also be useful if source and target files live
  57. on separate machines with clocks being out of sync. <em>since Ant
  58. 1.6</em>.</td>
  59. <td valign="top" align="center">No.</td>
  60. </tr>
  61. </table>
  62. <h3>Parameters specified as nested elements</h3>
  63. <h4>fileset</h4>
  64. <p><a href="../CoreTypes/fileset.html">FileSet</a>s are used to select
  65. sets of files and directories.</p>
  66. <h4>preserveInTarget</h4>
  67. <p>Specifies files or directories that should be kept in the target
  68. directory even if they are not present in one of the source
  69. directories.</p>
  70. <p>This nested element is like a <a
  71. href="../CoreTypes/fileset.html">FileSet</a> except that it doesn't
  72. support the dir attribute and the usedefaultexcludes attribute
  73. defaults to false.</p>
  74. <h3>Examples</h3>
  75. <blockquote><pre>
  76. &lt;sync todir=&quot;site&quot;&gt;
  77. &lt;fileset dir=&quot;generated-site&quot;/&gt;
  78. &lt;/sync&gt;
  79. </pre></blockquote>
  80. <p>overwrites all files in <em>site</em> with newer files from
  81. <em>generated-site</em>, deletes files from <em>site</em> that are not
  82. present in <em>generated-site</em>.</p>
  83. <blockquote><pre>
  84. &lt;sync todir=&quot;site&quot;&gt;
  85. &lt;fileset dir=&quot;generated-site&quot;/&gt;
  86. &lt;preserveintarget&gt;
  87. &lt;include name=&quot;**/CVS/**&quot;/&gt;
  88. &lt;/preserveintarget&gt;
  89. &lt;/sync&gt;
  90. </pre></blockquote>
  91. <p>overwrites all files in <em>site</em> with newer files from
  92. <em>generated-site</em>, deletes files from <em>site</em> that are not
  93. present in <em>generated-site</em> but keeps all files in any
  94. <em>CVS</em> sub-directory.</p>
  95. <hr>
  96. <p align="center">Copyright &copy; 2003-2005 The Apache Software Foundation. All rights
  97. Reserved.</p>
  98. </body>
  99. </html>