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.

renameextensions.html 4.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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>RenameExtensions Task</title>
  20. </head>
  21. <body>
  22. <h2><a name="renameexts">RenameExtensions</a></h2>
  23. <h3><i>Deprecated</i></h3>
  24. <p><i>This task has been deprecated. Use the <a href="../CoreTasks/move.html">move</a>
  25. task with a <a href="../CoreTypes/mapper.html#glob-mapper">glob mapper</a> instead.</i></p>
  26. <h3>Description</h3>
  27. <p>Renames files in the <code>srcDir</code> directory ending with the
  28. <code>fromExtension</code> string so that they end with the
  29. <code>toExtension</code> string. Files are only replaced if
  30. <code>replace</code> is true
  31. </p>
  32. <p>See the section on
  33. <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the
  34. inclusion/exclusion of files works, and how to write patterns.
  35. This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and
  36. supports all attributes of <code>&lt;fileset&gt;</code>
  37. (<code>dir</code> becomes <code>srcDir</code>) as well as the nested
  38. <code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
  39. <code>&lt;patternset&gt;</code> elements.</p>
  40. <h3>Parameters</h3>
  41. <table border="1" cellpadding="2" cellspacing="0">
  42. <tr>
  43. <td valign="top"><b>Attribute</b></td>
  44. <td valign="top"><b>Description</b></td>
  45. <td align="center" valign="top"><b>Required</b></td>
  46. </tr>
  47. <tr>
  48. <td valign="top">defaultexcludes</td>
  49. <td valign="top">indicates whether default excludes should be used or not
  50. (&quot;yes&quot;/&quot;no&quot;). Default excludes are used when
  51. omitted.</td>
  52. <td valign="top" align="center">No</td>
  53. </tr>
  54. <tr>
  55. <td valign="top">excludes</td>
  56. <td valign="top">comma- or space-separated list of patterns of files that must be
  57. excluded. No files (except default excludes) are excluded when
  58. 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">fromExtention</td>
  69. <td valign="top">The string that files must end in to be renamed</td>
  70. <td valign="top" align="center">Yes</td>
  71. </tr>
  72. <tr>
  73. <td valign="top">includes</td>
  74. <td valign="top">comma- or space-separated list of patterns of files that must be
  75. included. All files are included when omitted.</td>
  76. <td valign="top" align="center">No</td>
  77. </tr>
  78. <tr>
  79. <td valign="top">includesfile</td>
  80. <td valign="top">the name of a file. Each line of this file is
  81. taken to be an include pattern</td>
  82. <td valign="top" align="center">No</td>
  83. </tr>
  84. <tr>
  85. <td valign="top">replace</td>
  86. <td valign="top">Whether the file being renamed to should be
  87. replaced if it already exists</td>
  88. <td valign="top" align="center">No</td>
  89. </tr>
  90. <tr>
  91. <td valign="top">srcDir</td>
  92. <td valign="top">The starting directory for files to search in</td>
  93. <td valign="top" align="center">Yes</td>
  94. </tr>
  95. <tr>
  96. <td valign="top">toExtension</td>
  97. <td valign="top">The string that renamed files will end with on
  98. completion</td>
  99. <td valign="top" align="center">Yes</td>
  100. </tr>
  101. </table>
  102. <h3>Examples</h3>
  103. <blockquote>
  104. <p><code>&lt;renameext srcDir=&quot;/source/project1&quot;
  105. includes=&quot;**&quot;
  106. excludes=&quot;**/samples/*&quot;
  107. fromExtension=&quot;.java.keep&quot;
  108. toExtension=&quot;.java&quot;
  109. replace=&quot;true&quot;/&gt;
  110. </code>
  111. </p>
  112. </blockquote>
  113. </body>
  114. </html>