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.

copydir.html 4.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Apache Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="copydir">Copydir</a></h2>
  8. <h3><i>Deprecated</i></h3>
  9. <p><i>This task has been deprecated. Use the Copy task instead.</i></p>
  10. <h3>Description</h3>
  11. <p>Copies a directory tree from the source to the destination.</p>
  12. <p>It is possible to refine the set of files that are being copied. This can be
  13. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  14. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  15. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  16. the files you want to have excluded. This is also done with patterns. And
  17. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  18. want to use default exclusions or not. See the section on <a
  19. href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
  20. inclusion/exclusion of files works, and how to write patterns.</p>
  21. <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
  22. supports all attributes of <code>&lt;fileset&gt;</code>
  23. (<code>dir</code> becomes <code>src</code>) as well as the nested
  24. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  25. <code>&lt;patternset&gt;</code> elements.</p>
  26. <h3>Parameters</h3>
  27. <table border="1" cellpadding="2" cellspacing="0">
  28. <tr>
  29. <td valign="top"><b>Attribute</b></td>
  30. <td valign="top"><b>Description</b></td>
  31. <td align="center" valign="top"><b>Required</b></td>
  32. </tr>
  33. <tr>
  34. <td valign="top">src</td>
  35. <td valign="top">the directory to copy.</td>
  36. <td valign="top" align="center">Yes</td>
  37. </tr>
  38. <tr>
  39. <td valign="top">dest</td>
  40. <td valign="top">the directory to copy to.</td>
  41. <td valign="top" align="center">Yes</td>
  42. </tr>
  43. <tr>
  44. <td valign="top">includes</td>
  45. <td valign="top">comma separated list of patterns of files that must be
  46. included. All files are included when omitted.</td>
  47. <td valign="top" align="center">No</td>
  48. </tr>
  49. <tr>
  50. <td valign="top">includesfile</td>
  51. <td valign="top">the name of a file. Each line of this file is
  52. taken to be an include pattern</td>
  53. <td valign="top" align="center">No</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">excludes</td>
  57. <td valign="top">comma separated list of patterns of files that must be
  58. excluded. No files (except default excludes) are excluded when omitted.</td>
  59. <td valign="top" align="center">No</td>
  60. </tr>
  61. <tr>
  62. <td valign="top">excludesfile</td>
  63. <td valign="top">the name of a file. Each line of this file is
  64. taken to be an exclude pattern</td>
  65. <td valign="top" align="center">No</td>
  66. </tr>
  67. <tr>
  68. <td valign="top">defaultexcludes</td>
  69. <td valign="top">indicates whether default excludes should be used or not
  70. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  71. <td valign="top" align="center">No</td>
  72. </tr>
  73. <tr>
  74. <td valign="top">filtering</td>
  75. <td valign="top">indicates whether token filtering should take place during
  76. the copy</td>
  77. <td valign="top" align="center">No</td>
  78. </tr>
  79. <tr>
  80. <td valign="top">flatten</td>
  81. <td valign="top">ignore directory structure of source directory,
  82. copy all files into a single directory, specified by the <code>dest</code>
  83. attribute (default is <code>false</code>).</td>
  84. <td valign="top" align="center">No</td>
  85. </tr>
  86. <tr>
  87. <td valign="top">forceoverwrite</td>
  88. <td valign="top">overwrite existing files even if the destination
  89. files are newer (default is false).</td>
  90. <td valign="top" align="center">No</td>
  91. </tr>
  92. </table>
  93. <h3>Examples</h3>
  94. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  95. dest=&quot;${dist}&quot;
  96. /&gt;</pre>
  97. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>.</p>
  98. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  99. dest=&quot;${dist}&quot;
  100. includes=&quot;**/*.java&quot;
  101. excludes=&quot;**/Test.java&quot;
  102. /&gt;</pre>
  103. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  104. recursively. All java files are copied, except for files with the name <code>Test.java</code>.</p>
  105. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  106. dest=&quot;${dist}&quot;
  107. includes=&quot;**/*.java&quot;
  108. excludes=&quot;mypackage/test/**&quot;/&gt;</pre>
  109. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  110. recursively. All java files are copied, except for the files under the <code>mypackage/test</code>
  111. directory.</p>
  112. <hr><p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  113. Reserved.</p>
  114. </body>
  115. </html>