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.

pack.html 2.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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>GZip/BZip2/XZ Tasks</title>
  20. </head>
  21. <body>
  22. <h2 id="pack">GZip/BZip2/XZ</h2>
  23. <h3>Description</h3>
  24. <p>Packs a resource using the GZip, BZip2 or XZ algorithm. The output file is only generated if it
  25. doesn't exist or the source resource is newer.</p>
  26. <p>XZ compression support has been added <em>since Apache Ant 1.10.1</em> and depends on external
  27. libraries not included in the Ant distribution.
  28. See <a href="../install.html#librarydependencies">Library Dependencies</a> for more information.</p>
  29. <h3>Parameters</h3>
  30. <table class="attr">
  31. <tr>
  32. <th>Attribute</th>
  33. <th>Description</th>
  34. <th>Required</th>
  35. </tr>
  36. <tr>
  37. <td>src</td>
  38. <td>the file to gzip/bzip/xz.</td>
  39. <td>Yes, or a nested resource collection</td>
  40. </tr>
  41. <tr>
  42. <td>destfile</td>
  43. <td>the destination file to create.</td>
  44. <td rowspan="2">Exactly one of the two</td>
  45. </tr>
  46. <tr>
  47. <td>zipfile</td>
  48. <td class="left"><em><u>deprecated</u></em> old name of <var>destfile</var>.</td>
  49. </tr>
  50. </table>
  51. <h3>Parameters specified as nested elements</h3>
  52. <h4>any <a href="../Types/resources.html">resource</a> or single element resource collection</h4>
  53. <p><em>Since Apache Ant 1.7</em></p>
  54. <p>The specified resource will be used as <var>src</var>.</p>
  55. <h3>Examples</h3>
  56. <pre>&lt;gzip src=&quot;test.tar&quot; destfile=&quot;test.tar.gz&quot;/&gt;</pre>
  57. <pre>&lt;bzip2 src=&quot;test.tar&quot; destfile=&quot;test.tar.bz2&quot;/&gt;</pre>
  58. <pre>&lt;xz src=&quot;test.tar&quot; destfile=&quot;test.tar.xz&quot;/&gt;</pre>
  59. <pre>
  60. &lt;gzip destfile=&quot;archive.tar.gz&quot;&gt;
  61. &lt;url url="http://example.org/archive.tar"/&gt;
  62. &lt;/gzip&gt;</pre>
  63. <p>downloads <samp>http://example.org/archive.tar</samp> and compresses it
  64. to <samp>archive.tar.gz</samp> in the project's <var>basedir</var> on the fly.</p>
  65. </body>
  66. </html>