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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 id="copydir">Copydir</h2>
  23. <h3><em><u>Deprecated</u></em></h3>
  24. <p><em>This task has been <u>deprecated</u>. Use the <code>Copy</code> task instead.</em></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 done with
  28. the <var>includes</var>, <var>includesfile</var>, <var>excludes</var>, <var>excludesfile</var>
  29. and <var>defaultexcludes</var> attributes. With the <var>includes</var> or <var>includesfile</var>
  30. attribute you specify the files you want to have included by using patterns. The <var>exclude</var>
  31. or <var>excludesfile</var> attribute is used to specify the files you want to have excluded. This is
  32. also done with patterns. And finally with the <var>defaultexcludes</var> attribute, you can specify
  33. whether you want to use default exclusions or not. See the section
  34. on <a 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 supports most
  37. attributes of <code>&lt;fileset&gt;</code> (<var>dir</var> becomes <var>src</var>) as well as the
  38. nested <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code>
  39. and <code>&lt;patternset&gt;</code> elements.</p>
  40. <h3>Parameters</h3>
  41. <table class="attr">
  42. <tr>
  43. <th>Attribute</th>
  44. <th>Description</th>
  45. <th>Required</th>
  46. </tr>
  47. <tr>
  48. <td>src</td>
  49. <td>the directory to copy.</td>
  50. <td>Yes</td>
  51. </tr>
  52. <tr>
  53. <td>dest</td>
  54. <td>the directory to copy to.</td>
  55. <td>Yes</td>
  56. </tr>
  57. <tr>
  58. <td>includes</td>
  59. <td>comma- or space-separated list of patterns of files that must be included.</td>
  60. <td>No; defaults to all (<q>**</q>)</td>
  61. </tr>
  62. <tr>
  63. <td>includesfile</td>
  64. <td>name of a file. Each line of this file is taken to be an include pattern</td>
  65. <td>No</td>
  66. </tr>
  67. <tr>
  68. <td>excludes</td>
  69. <td>comma- or space-separated list of patterns of files that must be excluded.</td>
  70. <td>No; defaults to default excludes or none if <var>defaultexcludes</var> is <q>no</q></td>
  71. </tr>
  72. <tr>
  73. <td>excludesfile</td>
  74. <td>name of a file. Each line of this file is taken to be an exclude pattern</td>
  75. <td>No</td>
  76. </tr>
  77. <tr>
  78. <td>defaultexcludes</td>
  79. <td>indicates whether default excludes should be used or not (<q>yes|no</q>).</td>
  80. <td>No; defaults to <q>yes</q></td>
  81. </tr>
  82. <tr>
  83. <td>filtering</td>
  84. <td>indicates whether token filtering should take place during the copy</td>
  85. <td>No; default is <q>false</q></td>
  86. </tr>
  87. <tr>
  88. <td>flatten</td>
  89. <td>ignore directory structure of source directory, copy all files into a single directory,
  90. specified by the <code>dest</code> attribute.</td>
  91. <td>No; default is <q>false</q></td>
  92. </tr>
  93. <tr>
  94. <td>forceoverwrite</td>
  95. <td>overwrite existing files even if the destination files are newer.</td>
  96. <td>No; default is <q>false</q></td>
  97. </tr>
  98. </table>
  99. <h3>Examples</h3>
  100. <pre>
  101. &lt;copydir src=&quot;${src}/resources&quot;
  102. dest=&quot;${dist}&quot;/&gt;</pre>
  103. <p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp>.</p>
  104. <pre>
  105. &lt;copydir src=&quot;${src}/resources&quot;
  106. dest=&quot;${dist}&quot;
  107. includes=&quot;**/*.java&quot;
  108. excludes=&quot;**/Test.java&quot;/&gt;</pre>
  109. <p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp>
  110. recursively. All <samp>.java</samp> files are copied, except for files with the
  111. name <samp>Test.java</samp>.</p>
  112. <pre>
  113. &lt;copydir src=&quot;${src}/resources&quot;
  114. dest=&quot;${dist}&quot;
  115. includes=&quot;**/*.java&quot;
  116. excludes=&quot;mypackage/test/**&quot;/&gt;</pre>
  117. <p>copies the directory <samp>${src}/resources</samp> to <samp>${dist}</samp>
  118. recursively. All <samp>.java</samp> files are copied, except for the files under
  119. the <samp>mypackage/test</samp> directory.</p>
  120. </body>
  121. </html>