Browse Source

document XZ support - PR 60350

master
Stefan Bodewig 8 years ago
parent
commit
6a40bdb9d3
8 changed files with 68 additions and 18 deletions
  1. +10
    -0
      WHATSNEW
  2. +12
    -3
      manual/Tasks/pack.html
  3. +18
    -9
      manual/Tasks/unpack.html
  4. +13
    -0
      manual/Types/resources.html
  5. +6
    -0
      manual/install.html
  6. +2
    -0
      manual/tasklist.html
  7. +4
    -4
      manual/tasksoverview.html
  8. +3
    -2
      src/main/org/apache/tools/ant/taskdefs/Untar.java

+ 10
- 0
WHATSNEW View File

@@ -1,6 +1,16 @@
Changes from Ant 1.10.0 TO Ant 1.10.1
=====================================

Other changes:
--------------

* new tasks <xz> and <unxz> and resource <xzresource> for XZ
compression. Also the compression attribute of <tar>/<untar> now
accepts "xz" as valid value.
The tasks and type are contained in the new ant-xz.jar and require
the library XZ for Java to be on the CLASSPATH.
Bugzilla Report 60350

Changes from Ant 1.9.7 TO Ant 1.10.0
====================================



+ 12
- 3
manual/Tasks/pack.html View File

@@ -19,16 +19,22 @@
<head>
<meta http-equiv="Content-Language" content="en-us">
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>GZip/BZip2 Tasks</title>
<title>GZip/BZip2/XZ Tasks</title>
</head>

<body>

<h2><a name="pack">GZip/BZip2</a></h2>
<h3>Description</h3>
<p>Packs a resource using the GZip or BZip2 algorithm.
<p>Packs a resource using the GZip, BZip2 or XZ algorithm.
The output file is only generated if it doesn't exist or the source
resource is newer.</p>

<p>XZ compression support has been added with Apache Ant 1.10.1 and
depends on external libraries not included in the Ant distribution.
See <a href="../install.html#librarydependencies">Library
Dependencies</a> for more information.</p>

<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -38,7 +44,7 @@ resource is newer.</p>
</tr>
<tr>
<td valign="top">src</td>
<td valign="top">the file to gzip/bzip.</td>
<td valign="top">the file to gzip/bzip/xz.</td>
<td align="center" valign="top">Yes, or a nested resource collection.</td>
</tr>
<tr>
@@ -64,6 +70,9 @@ resource collection</h4>
&lt;bzip2 src=&quot;test.tar&quot; destfile=&quot;test.tar.bz2&quot;/&gt;
</pre></blockquote>
<blockquote><pre>
&lt;xz src=&quot;test.tar&quot; destfile=&quot;test.tar.xz&quot;/&gt;
</pre></blockquote>
<blockquote><pre>
&lt;gzip destfile=&quot;archive.tar.gz&quot;&gt;
&lt;url url="http://example.org/archive.tar"/&gt;
&lt;/gzip&gt;


+ 18
- 9
manual/Tasks/unpack.html View File

@@ -24,17 +24,22 @@

<body>

<h2><a name="unpack">GUnzip/BUnzip2</a></h2>
<h2><a name="unpack">GUnzip/BUnzip2/UnXZ</a></h2>
<h3>Description</h3>
<p>Expands a resource packed using GZip or BZip2.</p>
<p>Expands a resource packed using GZip, BZip2 or XZ.</p>

<p>If <i>dest</i> is a directory the name of the destination file is
the same as <i>src</i> (with the &quot;.gz&quot; or &quot;.bz2&quot;
the same as <i>src</i> (with the &quot;.gz&quot;, &quot;.bz2&quot; or &quot;.xz&quot;
extension removed if present). If <i>dest</i> is omitted, the parent
dir of <i>src</i> is taken. The file is only expanded if the source
resource is newer than the destination file, or when the destination file
does not exist.</p>

<p>XZ compression support has been added with Apache Ant 1.10.1 and
depends on external libraries not included in the Ant distribution.
See <a href="../install.html#librarydependencies">Library
Dependencies</a> for more information.</p>

<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -70,6 +75,10 @@ resource collection</h4>
</pre></blockquote>
<p>expands <i>test.tar.bz2</i> to <i>test.tar</i></p>
<blockquote><pre>
&lt;uncz src=&quot;test.tar.xz&quot;/&gt;
</pre></blockquote>
<p>expands <i>test.tar.xz</i> to <i>test.tar</i></p>
<blockquote><pre>
&lt;gunzip src=&quot;test.tar.gz&quot; dest=&quot;test2.tar&quot;/&gt;
</pre></blockquote>
<p>expands <i>test.tar.gz</i> to <i>test2.tar</i></p>
@@ -104,12 +113,12 @@ is identical to
</pre>

<p>The same is also true for <code>&lt;bunzip2&gt;</code> and
<code>&lt;bzip2resource&gt;</code>. <code>&lt;copy&gt;</code> offers
additional features like <a
href="../Types/filterchain.html">filtering files</a> on the fly,
allowing a file to be mapped to multiple destinations, preserving the
last modified time or a configurable file system timestamp
granularity.</p>
<code>&lt;bzip2resource&gt;</code> or <code>%lt;unxz&gt;</code>
and <code>%lt;xzresource&gt;</code>. <code>&lt;copy&gt;</code> offers
additional features like <a href="../Types/filterchain.html">filtering
files</a> on the fly, allowing a file to be mapped to multiple
destinations, preserving the last modified time or a configurable file
system timestamp granularity.</p>





+ 13
- 0
manual/Types/resources.html View File

@@ -49,6 +49,7 @@ explicit use beginning in <b>Ant 1.7</b>.
<li><a href="#string">string</a> - a text string.</li>
<li><a href="#tarentry">tarentry</a> - an entry in a tar file.</li>
<li><a href="#url">url</a> - a URL.</li>
<li><a href="#xzresource">xzresource</a> - an XZ compressed resource.</li>
<li><a href="#zipentry">zipentry</a> - an entry in a zip file.</li>
</ul>

@@ -277,6 +278,18 @@ resource providing compression of the resource's contents on the fly.
A single element resource collection must be specified as a nested
element.</p>

<h4><a name="xzresource">xzresource</a></h4>

<p>This is not a stand-alone resource, but a wrapper around another
resource providing compression of the resource's contents on the fly.
A single element resource collection must be specified as a nested
element.</p>

<p>XZ compression support has been added with Apache Ant 1.10.1 and
depends on external libraries not included in the Ant distribution.
See <a href="../install.html#librarydependencies">Library
Dependencies</a> for more information.</p>

<h4><a name="url">url</a></h4>

<p>Represents a URL.</p>


+ 6
- 0
manual/install.html View File

@@ -1018,6 +1018,12 @@ you need jakarta-oro 2.0.8 or later, and <a href="#commons-net">commons-net</a><
<td><a href="https://jai.dev.java.net/"
target="_top">https://jai.dev.java.net/</a></td>
</tr>
<tr>
<td>XZ - XZ for Java <b>1.6 or later</b></td>
<td>xz and unxz tasks, xzresource, xz compression in tar/untar</td>
<td><a href="http://www.tukaani.org/xz/java.html"
target="_top">http://www.tukaani.org/xz/java.html</a></td>
</tr>
</table>
<br>
<h2><a name="Troubleshooting">Troubleshooting</a></h2>


+ 2
- 0
manual/tasklist.html View File

@@ -178,6 +178,7 @@
<li><a href="Tasks/unzip.html">Unjar</a></li>
<li><a href="Tasks/unzip.html">Untar</a></li>
<li><a href="Tasks/unzip.html">Unwar</a></li>
<li><a href="Tasks/unpack.html">UnXZ</a></li>
<li><a href="Tasks/unzip.html">Unzip</a></li>
<li><a href="Tasks/uptodate.html">Uptodate</a></li>
<li><a href="Tasks/verifyjar.html">VerifyJar</a></li>
@@ -188,6 +189,7 @@
<li><a href="Tasks/wljspc.html">Weblogic JSP Compiler</a></li>
<li><a href="Tasks/xmlproperty.html">XmlProperty</a></li>
<li><a href="Tasks/xmlvalidate.html">XmlValidate</a></li>
<li><a href="Tasks/pack.html">XZ</a></li>
<li><a href="Tasks/style.html">XSLT/<i>Style</i></a></li>
<li><a href="Tasks/zip.html">Zip</a></li>
</ul>


+ 4
- 4
manual/tasksoverview.html View File

@@ -67,13 +67,13 @@ documentation.</p>
</tr>

<tr valign="top">
<td nowrap><a href="Tasks/unpack.html">BUnzip2</a></td>
<td><p>Expands a file packed using GZip or BZip2.</p></td>
<td nowrap><a href="Tasks/unpack.html">GUnzip/BUnzip2/UnXZ</a></td>
<td><p>Expands a file packed using GZip, BZip2 or XZ.</p></td>
</tr>

<tr valign="top">
<td nowrap><a href="Tasks/pack.html">BZip2</a></td>
<td><p>Packs a file using the GZip or BZip2 algorithm. This task
<td nowrap><a href="Tasks/pack.html">GZip/BZip2/XZ</a></td>
<td><p>Packs a file using the GZip, BZip2 or XZ algorithm. This task
does not do any dependency checking; the output file is always
generated</p></td>
</tr>


+ 3
- 2
src/main/org/apache/tools/ant/taskdefs/Untar.java View File

@@ -18,13 +18,13 @@

package org.apache.tools.ant.taskdefs;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.zip.GZIPInputStream;

import org.apache.tools.ant.BuildException;
@@ -72,6 +72,7 @@ public class Untar extends Expand {
* <li>none - no compression
* <li>gzip - Gzip compression
* <li>bzip2 - Bzip2 compression
* <li>xz - XZ compression, requires XZ for Java
* </ul>
*
* @param method compression method


Loading…
Cancel
Save