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

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