From 6a40bdb9d3797a0f081184807f58a79122e0f6bd Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 12 Jan 2017 17:19:15 +0100 Subject: [PATCH] document XZ support - PR 60350 --- WHATSNEW | 10 +++++++ manual/Tasks/pack.html | 15 ++++++++--- manual/Tasks/unpack.html | 27 ++++++++++++------- manual/Types/resources.html | 13 +++++++++ manual/install.html | 6 +++++ manual/tasklist.html | 2 ++ manual/tasksoverview.html | 8 +++--- .../org/apache/tools/ant/taskdefs/Untar.java | 5 ++-- 8 files changed, 68 insertions(+), 18 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index cd71f3408..540bc1c12 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1,6 +1,16 @@ Changes from Ant 1.10.0 TO Ant 1.10.1 ===================================== +Other changes: +-------------- + + * new tasks and and resource for XZ + compression. Also the compression attribute of / 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 ==================================== diff --git a/manual/Tasks/pack.html b/manual/Tasks/pack.html index 60ae1e527..b673333df 100644 --- a/manual/Tasks/pack.html +++ b/manual/Tasks/pack.html @@ -19,16 +19,22 @@ -GZip/BZip2 Tasks +GZip/BZip2/XZ Tasks

GZip/BZip2

Description

-

Packs a resource using the GZip or BZip2 algorithm. +

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.

+ +

XZ compression support has been added with Apache Ant 1.10.1 and +depends on external libraries not included in the Ant distribution. +See Library +Dependencies for more information.

+

Parameters

@@ -38,7 +44,7 @@ resource is newer.

- + @@ -64,6 +70,9 @@ resource collection <bzip2 src="test.tar" destfile="test.tar.bz2"/>
+<xz src="test.tar" destfile="test.tar.xz"/>
+
+
 <gzip destfile="archive.tar.gz">
   <url url="http://example.org/archive.tar"/>
 </gzip>
diff --git a/manual/Tasks/unpack.html b/manual/Tasks/unpack.html
index dcc88a9a8..f7def5de8 100644
--- a/manual/Tasks/unpack.html
+++ b/manual/Tasks/unpack.html
@@ -24,17 +24,22 @@
 
 
 
-

GUnzip/BUnzip2

+

GUnzip/BUnzip2/UnXZ

Description

-

Expands a resource packed using GZip or BZip2.

+

Expands a resource packed using GZip, BZip2 or XZ.

If dest is a directory the name of the destination file is -the same as src (with the ".gz" or ".bz2" +the same as src (with the ".gz", ".bz2" or ".xz" extension removed if present). If dest is omitted, the parent dir of src 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.

+

XZ compression support has been added with Apache Ant 1.10.1 and +depends on external libraries not included in the Ant distribution. +See Library +Dependencies for more information.

+

Parameters

srcthe file to gzip/bzip.the file to gzip/bzip/xz. Yes, or a nested resource collection.
@@ -70,6 +75,10 @@ resource collection

expands test.tar.bz2 to test.tar

+<uncz src="test.tar.xz"/>
+
+

expands test.tar.xz to test.tar

+
 <gunzip src="test.tar.gz" dest="test2.tar"/>
 

expands test.tar.gz to test2.tar

@@ -104,12 +113,12 @@ is identical to

The same is also true for <bunzip2> and -<bzip2resource>. <copy> offers -additional features like filtering files on the fly, -allowing a file to be mapped to multiple destinations, preserving the -last modified time or a configurable file system timestamp -granularity.

+<bzip2resource> or %lt;unxz> +and %lt;xzresource>. <copy> offers +additional features like filtering +files on the fly, allowing a file to be mapped to multiple +destinations, preserving the last modified time or a configurable file +system timestamp granularity.

diff --git a/manual/Types/resources.html b/manual/Types/resources.html index 8ba77aa12..b90ee23cc 100644 --- a/manual/Types/resources.html +++ b/manual/Types/resources.html @@ -49,6 +49,7 @@ explicit use beginning in Ant 1.7.
  • string - a text string.
  • tarentry - an entry in a tar file.
  • url - a URL.
  • +
  • xzresource - an XZ compressed resource.
  • zipentry - an entry in a zip file.
  • @@ -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.

    +

    xzresource

    + +

    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.

    + +

    XZ compression support has been added with Apache Ant 1.10.1 and +depends on external libraries not included in the Ant distribution. +See Library +Dependencies for more information.

    +

    url

    Represents a URL.

    diff --git a/manual/install.html b/manual/install.html index 818b168da..51ab7215d 100644 --- a/manual/install.html +++ b/manual/install.html @@ -1018,6 +1018,12 @@ you need jakarta-oro 2.0.8 or later, and commons-net< + + + + +
    https://jai.dev.java.net/
    XZ - XZ for Java 1.6 or laterxz and unxz tasks, xzresource, xz compression in tar/untarhttp://www.tukaani.org/xz/java.html

    Troubleshooting

    diff --git a/manual/tasklist.html b/manual/tasklist.html index b57c85136..5829b4d89 100644 --- a/manual/tasklist.html +++ b/manual/tasklist.html @@ -178,6 +178,7 @@
  • Unjar
  • Untar
  • Unwar
  • +
  • UnXZ
  • Unzip
  • Uptodate
  • VerifyJar
  • @@ -188,6 +189,7 @@
  • Weblogic JSP Compiler
  • XmlProperty
  • XmlValidate
  • +
  • XZ
  • XSLT/Style
  • Zip
  • diff --git a/manual/tasksoverview.html b/manual/tasksoverview.html index d04fb4fff..776082c83 100644 --- a/manual/tasksoverview.html +++ b/manual/tasksoverview.html @@ -67,13 +67,13 @@ documentation.

    - BUnzip2 -

    Expands a file packed using GZip or BZip2.

    + GUnzip/BUnzip2/UnXZ +

    Expands a file packed using GZip, BZip2 or XZ.

    - BZip2 -

    Packs a file using the GZip or BZip2 algorithm. This task + GZip/BZip2/XZ +

    Packs a file using the GZip, BZip2 or XZ algorithm. This task does not do any dependency checking; the output file is always generated

    diff --git a/src/main/org/apache/tools/ant/taskdefs/Untar.java b/src/main/org/apache/tools/ant/taskdefs/Untar.java index 8e841c006..c3e6e15f7 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Untar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Untar.java @@ -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 { *
  • none - no compression *
  • gzip - Gzip compression *
  • bzip2 - Bzip2 compression + *
  • xz - XZ compression, requires XZ for Java * * * @param method compression method