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.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.
  25. The output file is only generated if it doesn't exist or the source
  26. resource is newer.</p>
  27. <p>XZ compression support has been added with Apache Ant 1.10.1 and
  28. depends on external libraries not included in the Ant distribution.
  29. See <a href="../install.html#librarydependencies">Library
  30. Dependencies</a> for more information.</p>
  31. <h3>Parameters</h3>
  32. <table>
  33. <tr>
  34. <td valign="top"><b>Attribute</b></td>
  35. <td valign="top"><b>Description</b></td>
  36. <td align="center" valign="top"><b>Required</b></td>
  37. </tr>
  38. <tr>
  39. <td valign="top">src</td>
  40. <td valign="top">the file to gzip/bzip/xz.</td>
  41. <td align="center" valign="top">Yes, or a nested resource collection.</td>
  42. </tr>
  43. <tr>
  44. <td valign="top">destfile</td>
  45. <td valign="top">the destination file to create.</td>
  46. <td align="center" valign="top" rowspan="2">Exactly one of the two</td>
  47. </tr>
  48. <tr>
  49. <td valign="top">zipfile</td>
  50. <td valign="top">the <i>deprecated</i> old name of destfile.</td>
  51. </tr>
  52. </table>
  53. <h4>any <a href="../Types/resources.html">resource</a> or single element
  54. resource collection</h4>
  55. <p>The specified resource will be used as src. <em>Since Apache Ant 1.7</em></p>
  56. <h3>Examples</h3>
  57. <blockquote><pre>
  58. &lt;gzip src=&quot;test.tar&quot; destfile=&quot;test.tar.gz&quot;/&gt;
  59. </pre></blockquote>
  60. <blockquote><pre>
  61. &lt;bzip2 src=&quot;test.tar&quot; destfile=&quot;test.tar.bz2&quot;/&gt;
  62. </pre></blockquote>
  63. <blockquote><pre>
  64. &lt;xz src=&quot;test.tar&quot; destfile=&quot;test.tar.xz&quot;/&gt;
  65. </pre></blockquote>
  66. <blockquote><pre>
  67. &lt;gzip destfile=&quot;archive.tar.gz&quot;&gt;
  68. &lt;url url="http://example.org/archive.tar"/&gt;
  69. &lt;/gzip&gt;
  70. </pre></blockquote>
  71. <p>downloads <i>http://example.org/archive.tar</i> and compresses it
  72. to <i>archive.tar.gz</i> in the project's basedir on the fly.</p>
  73. </body>
  74. </html>