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.

filter.html 2.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. https://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <html lang="en">
  17. <head>
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Filter Task</title>
  20. </head>
  21. <body>
  22. <h2 id="filter">Filter</h2>
  23. <h3>Description</h3>
  24. <p>Sets a token filter for this project or reads a properties file as multiple token filter
  25. definitions and sets them. Token filters are used by all tasks that perform file copying operations
  26. through the Project commodity methods. See the
  27. warning <a href="../using.html#filters"><em>here</em></a> before using.</p>
  28. <p>The task uses <q>@</q> as token separator. Token strings cannot contain separator characters;
  29. incorrect tokens are ignored.</p>
  30. <h3>Parameters</h3>
  31. <table class="attr">
  32. <tr>
  33. <th scope="col">Attribute</th>
  34. <th scope="col">Description</th>
  35. <th scope="col">Required</th>
  36. </tr>
  37. <tr>
  38. <td>token</td>
  39. <td>the token string without the separator chars (<q>@</q>)</td>
  40. <td rowspan="3">Yes; either both <var>token</var> and <var>value</var>, or
  41. only <var>filtersfile</var></td>
  42. </tr>
  43. <tr>
  44. <td>value</td>
  45. <td class="left">the string that should be put to replace the token when the file is copied</td>
  46. </tr>
  47. <tr>
  48. <td>filtersfile</td>
  49. <td class="left">The file from which the filters must be read. This file must be a formatted as
  50. a property file.</td>
  51. </tr>
  52. </table>
  53. <h3>Examples</h3>
  54. <p>Copy recursively all the files from the <samp>src.dir</samp> directory into
  55. the <samp>dest.dir</samp> directory replacing all the occurrences of the string <code>@year@</code>
  56. with <q>2000</q>.</p>
  57. <pre>
  58. &lt;filter token=&quot;year&quot; value=&quot;2000&quot;/&gt;
  59. &lt;copy todir=&quot;${dest.dir}&quot; filtering=&quot;true&quot;&gt;
  60. &lt;fileset dir=&quot;${src.dir}&quot;/&gt;
  61. &lt;/copy&gt;</pre>
  62. <p>Read all property entries from the <samp>deploy_env.properties</samp> file and set these as
  63. filters.</p>
  64. <pre>&lt;filter filtersfile=&quot;deploy_env.properties&quot;/&gt;</pre>
  65. </body>
  66. </html>