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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <!--
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Copydir Task</title>
  20. </head>
  21. <body>
  22. <h2><a name="copydir">Copydir</a></h2>
  23. <h3><i>Deprecated</i></h3>
  24. <p><i>This task has been deprecated. Use the Copy task instead.</i></p>
  25. <h3>Description</h3>
  26. <p>Copies a directory tree from the source to the destination.</p>
  27. <p>It is possible to refine the set of files that are being copied. This can be
  28. done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i>
  29. attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to
  30. have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify
  31. the files you want to have excluded. This is also done with patterns. And
  32. finally with the <i>defaultexcludes</i> attribute, you can specify whether you
  33. want to use default exclusions or not. See the section on <a
  34. href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
  35. inclusion/exclusion of files works, and how to write patterns.</p>
  36. <p>This task forms an implicit <a href="../Types/fileset.html">FileSet</a> and
  37. supports most attributes of <code>&lt;fileset&gt;</code>
  38. (<code>dir</code> becomes <code>src</code>) as well as the nested
  39. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  40. <code>&lt;patternset&gt;</code> elements.</p>
  41. <h3>Parameters</h3>
  42. <table border="1" cellpadding="2" cellspacing="0">
  43. <tr>
  44. <td valign="top"><b>Attribute</b></td>
  45. <td valign="top"><b>Description</b></td>
  46. <td align="center" valign="top"><b>Required</b></td>
  47. </tr>
  48. <tr>
  49. <td valign="top">src</td>
  50. <td valign="top">the directory to copy.</td>
  51. <td valign="top" align="center">Yes</td>
  52. </tr>
  53. <tr>
  54. <td valign="top">dest</td>
  55. <td valign="top">the directory to copy to.</td>
  56. <td valign="top" align="center">Yes</td>
  57. </tr>
  58. <tr>
  59. <td valign="top">includes</td>
  60. <td valign="top">comma- or space-separated list of patterns of files that must be
  61. included. All files are included when omitted.</td>
  62. <td valign="top" align="center">No</td>
  63. </tr>
  64. <tr>
  65. <td valign="top">includesfile</td>
  66. <td valign="top">the name of a file. Each line of this file is
  67. taken to be an include pattern</td>
  68. <td valign="top" align="center">No</td>
  69. </tr>
  70. <tr>
  71. <td valign="top">excludes</td>
  72. <td valign="top">comma- or space-separated list of patterns of files that must be
  73. excluded. No files (except default excludes) are excluded when omitted.</td>
  74. <td valign="top" align="center">No</td>
  75. </tr>
  76. <tr>
  77. <td valign="top">excludesfile</td>
  78. <td valign="top">the name of a file. Each line of this file is
  79. taken to be an exclude pattern</td>
  80. <td valign="top" align="center">No</td>
  81. </tr>
  82. <tr>
  83. <td valign="top">defaultexcludes</td>
  84. <td valign="top">indicates whether default excludes should be used or not
  85. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when omitted.</td>
  86. <td valign="top" align="center">No</td>
  87. </tr>
  88. <tr>
  89. <td valign="top">filtering</td>
  90. <td valign="top">indicates whether token filtering should take place during
  91. the copy</td>
  92. <td valign="top" align="center">No</td>
  93. </tr>
  94. <tr>
  95. <td valign="top">flatten</td>
  96. <td valign="top">ignore directory structure of source directory,
  97. copy all files into a single directory, specified by the <code>dest</code>
  98. attribute (default is <code>false</code>).</td>
  99. <td valign="top" align="center">No</td>
  100. </tr>
  101. <tr>
  102. <td valign="top">forceoverwrite</td>
  103. <td valign="top">overwrite existing files even if the destination
  104. files are newer (default is false).</td>
  105. <td valign="top" align="center">No</td>
  106. </tr>
  107. </table>
  108. <h3>Examples</h3>
  109. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  110. dest=&quot;${dist}&quot;
  111. /&gt;</pre>
  112. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>.</p>
  113. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  114. dest=&quot;${dist}&quot;
  115. includes=&quot;**/*.java&quot;
  116. excludes=&quot;**/Test.java&quot;
  117. /&gt;</pre>
  118. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  119. recursively. All java files are copied, except for files with the name <code>Test.java</code>.</p>
  120. <pre> &lt;copydir src=&quot;${src}/resources&quot;
  121. dest=&quot;${dist}&quot;
  122. includes=&quot;**/*.java&quot;
  123. excludes=&quot;mypackage/test/**&quot;/&gt;</pre>
  124. <p>copies the directory <code>${src}/resources</code> to <code>${dist}</code>
  125. recursively. All java files are copied, except for the files under the <code>mypackage/test</code>
  126. directory.</p>
  127. </body>
  128. </html>