You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2018/02/06 20:48:15 UTC

[1/5] ant-antlibs-compress git commit: typo

Repository: ant-antlibs-compress
Updated Branches:
  refs/heads/master 405d27dc9 -> 2cb681358


typo


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/bd4ddf05
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/bd4ddf05
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/bd4ddf05

Branch: refs/heads/master
Commit: bd4ddf05f48af8960cdb278a8fb861084dfb0be9
Parents: 405d27d
Author: Stefan Bodewig <bo...@apache.org>
Authored: Tue Feb 6 12:43:04 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Tue Feb 6 12:43:04 2018 +0100

----------------------------------------------------------------------
 docs/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/bd4ddf05/docs/index.html
----------------------------------------------------------------------
diff --git a/docs/index.html b/docs/index.html
index 065030a..1208cf2 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -134,7 +134,7 @@
 
     <p>In order to use Brotli
       the <a href="https://github.com/google/brotli">Brotli dec</a>
-      library verision 0.1.2 or later is required.</p>
+      library version 0.1.2 or later is required.</p>
 
     <p>If you are building the Antlib from sources, run
       the <code>antlib</code> target and you'll get a


[2/5] ant-antlibs-compress git commit: forgot to update manual with Commons Compress version change

Posted by bo...@apache.org.
forgot to update manual with Commons Compress version change


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/576d0415
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/576d0415
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/576d0415

Branch: refs/heads/master
Commit: 576d0415ac43c13e24174121be664ff81df79ae9
Parents: bd4ddf0
Author: Stefan Bodewig <bo...@apache.org>
Authored: Tue Feb 6 12:43:48 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Tue Feb 6 17:51:08 2018 +0100

----------------------------------------------------------------------
 docs/index.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/576d0415/docs/index.html
----------------------------------------------------------------------
diff --git a/docs/index.html b/docs/index.html
index 1208cf2..44c7e01 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -28,7 +28,7 @@
     <p>This Antlib contains tasks and resources that provide
       compression/uncompression and archival/unarchival capabilities
       based on <a href="http://commons.apache.org/compress/">Apache
-      Commons Compress</a>.  Using Apache Commons Compress 1.14 this
+      Commons Compress</a>.  Using Apache Commons Compress 1.16 this
       Antlib supports gzip, bzip2, lzma standalone, xz, .Z, DEFLATE, DEFLATE64,
       Snappy, LZ4, Brotli and pack200 compression and ar, arj, cpio,
       7z, Unix dump, tar and zip archives.  Support for arj, .Z,
@@ -126,7 +126,7 @@
     <h3>Installing and Using</h3>
 
     <p>This Antlib requires Apache Ant 1.8.0 or higher, Apache
-      Commons Compress 1.14 or higher and Java7 or higher.</p>
+      Commons Compress 1.16 or higher and Java7 or higher.</p>
 
     <p>In order to use LZMA, XZ or most of the 7z support
       the <a href="https://tukaani.org/xz/java.html">XZ for Java</a>


[3/5] ant-antlibs-compress git commit: add Zstandard support

Posted by bo...@apache.org.
add Zstandard support


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/d282fff1
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/d282fff1
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/d282fff1

Branch: refs/heads/master
Commit: d282fff181fc597590abafe9b422e1a3300d1712
Parents: 576d041
Author: Stefan Bodewig <bo...@apache.org>
Authored: Tue Feb 6 21:46:26 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Tue Feb 6 21:46:26 2018 +0100

----------------------------------------------------------------------
 .gitattributes                                  |   9 ++
 changes.xml                                     |   6 +-
 docs/compresource.html                          |  23 ++++
 docs/index.html                                 |   9 +-
 docs/pack.html                                  |   7 ++
 docs/unpack.html                                |   7 ++
 ivy.xml                                         |   1 +
 src/main/org/apache/ant/compress/antlib.xml     |  12 ++
 .../ant/compress/resources/ZstdResource.java    |  37 +++++++
 .../apache/ant/compress/taskdefs/UnZstd.java    |  33 ++++++
 .../org/apache/ant/compress/taskdefs/Zstd.java  |  42 +++++++
 .../ant/compress/util/ZstdStreamFactory.java    |  53 +++++++++
 src/tests/antunit/unzstd-test.xml               |  65 +++++++++++
 src/tests/antunit/zstd-test.xml                 | 109 +++++++++++++++++++
 src/tests/antunit/zstdresource-test.xml         |  41 +++++++
 src/tests/resources/asf-logo.gif.zstd           | Bin 0 -> 6972 bytes
 16 files changed, 452 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/.gitattributes
----------------------------------------------------------------------
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..38bc65e
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,9 @@
+*.ar                                    binary
+*.arj                                   binary
+*.java                                  text diff=java
+*.md                                    text
+*.txt                                   text
+*.xml                                   text
+*.yml                                   text
+*.zstd                                  binary
+.gitattributes                          text

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/changes.xml
----------------------------------------------------------------------
diff --git a/changes.xml b/changes.xml
index e1875b4..f51f7a7 100644
--- a/changes.xml
+++ b/changes.xml
@@ -40,13 +40,17 @@
     <release version="1.6" date="unreleased">
       <action type="update" breaks-bwc="true">
         The Apache Compress Antlib now requires Apache Commons
-        Compress 1.16 or later for DEFLATE64 support.
+        Compress 1.16 or later for DEFLATE64 and Zstandard support.
+        zstd-jni 1.3.3-1 or later is required for Zstandard support.
       </action>
       <action type="add">
         Added read-only support for the DEFLATE64 format. More
         importantly we can now read zip and 7z entries using this
         algorithm.
       </action>
+      <action type="add">
+        Added support for the Zstandard format.
+      </action>
     </release>
     <release version="1.5" date="2017-06-13">
       <action type="update" breaks-bwc="true">

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/docs/compresource.html
----------------------------------------------------------------------
diff --git a/docs/compresource.html b/docs/compresource.html
index 57e85b3..3270a4c 100644
--- a/docs/compresource.html
+++ b/docs/compresource.html
@@ -313,3 +313,26 @@
 <p>Represents the entry named some-file.txt in archive
   some-archive.tar.Z where the <code>zresource</code> provides
   the decompression of the archive.</p>
+
+<h2><a name="zstdresource">zstdresource</a></h2>
+
+<p><em>Since Apache Compress Antlib 1.6</em>.</p>
+
+<p>This is a <a href="#compresource">compressed resource</a> using
+  Zstandard compression.</p>
+
+<h4>Examples</h4>
+
+<pre>
+&lt;cmp:tarentry xmlns:cmp="antlib:org.apache.ant.compress"
+    name="some-file.txt"&gt;
+  &lt;cmp:zstdresource&gt;
+    &lt;file file="some-archive.tar.zstd"/&gt;
+  &lt;/cmp:zstdresource&gt;
+&lt;/cmp:tarentry&gt;
+</pre>
+
+<p>Represents the entry named some-file.txt in archive
+  some-archive.tar.zstd where the <code>zstdresource</code> provides
+  the decompression of the archive.</p>
+

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/docs/index.html
----------------------------------------------------------------------
diff --git a/docs/index.html b/docs/index.html
index 44c7e01..da9cc1b 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -30,7 +30,7 @@
       based on <a href="http://commons.apache.org/compress/">Apache
       Commons Compress</a>.  Using Apache Commons Compress 1.16 this
       Antlib supports gzip, bzip2, lzma standalone, xz, .Z, DEFLATE, DEFLATE64,
-      Snappy, LZ4, Brotli and pack200 compression and ar, arj, cpio,
+      Snappy, LZ4, Brotli, Zstandard and pack200 compression and ar, arj, cpio,
       7z, Unix dump, tar and zip archives.  Support for arj, .Z,
       Brotli, DEFLATE64 and dump is read-only.  7z can only be used on filesystem
       resources.</p>
@@ -76,8 +76,10 @@
       <li><a href="unpack.html#unxz">unxz</a></li>
       <li><a href="unpack.html#unz">unz</a></li>
       <li><a href="expand.html#unzip">unzip</a></li>
+      <li><a href="unpack.html#unzstd">unzstd</a></li>
       <li><a href="pack.html#xz">xz</a></li>
       <li><a href="archive.html#zip">zip</a></li>
+      <li><a href="pack.html#zstd">zstd</a></li>
     </ul>
 
     <p>This Antlib contains the following resources:</p>
@@ -109,6 +111,7 @@
       <li><a href="entry.html#zipentry">zipentry</a></li>
       <li><a href="fileset.html#zipfileset">zipfileset</a></li>
       <li><a href="compresource.html#zresource">zresource</a></li>
+      <li><a href="compresource.html#zstdresource">zstdresource</a></li>
     </ul>
 
     <p>This Antlib contains the following conditions that work on the
@@ -136,6 +139,10 @@
       the <a href="https://github.com/google/brotli">Brotli dec</a>
       library version 0.1.2 or later is required.</p>
 
+    <p>In order to use Zstandard
+      the <a href="https://github.com/luben/zstd-jni">zstd-jni</a>
+      library version 1.3.3-1 or later is required.</p>
+
     <p>If you are building the Antlib from sources, run
       the <code>antlib</code> target and you'll get a
       file <code>ant-compress-VERSION.jar</code>.  If you've

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/docs/pack.html
----------------------------------------------------------------------
diff --git a/docs/pack.html b/docs/pack.html
index 2383102..7cc5499 100644
--- a/docs/pack.html
+++ b/docs/pack.html
@@ -277,6 +277,13 @@
   <p>Is a <a href="#pack">compressing task</a> that uses the XZ
     compression algorithm.</p>
 
+  <h3><a name="zstd">zstd</a></h3>
+
+  <p>Is a <a href="#pack">compressing task</a> that uses the Zstandard
+    compression algorithm.</p>
+
+  <p><em>Since Compress Antlib 1.6</em>
+
   <h3>Examples</h3>
   <pre>
     &lt;cmp:gzip src=&quot;test.tar&quot; dest=&quot;test.tar.gz&quot;

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/docs/unpack.html
----------------------------------------------------------------------
diff --git a/docs/unpack.html b/docs/unpack.html
index 9167598..24f226c 100644
--- a/docs/unpack.html
+++ b/docs/unpack.html
@@ -263,6 +263,13 @@ resource collection</h4>
 
 <p><em>Since Apache Compress Antlib 1.4</em>.</p>
 
+<h3><a name="unzstd">UnZstd</a></h3>
+
+<p>Is an <a href="#unpack">uncompressing task</a> that uses the Zstandard
+  compression algorithm.</p>
+
+<p><em>Since Apache Compress Antlib 1.6</em>.</p>
+
 <h3>Examples</h3>
 <blockquote><pre>
 &lt;cmp:gunzip src=&quot;test.tar.gz&quot; xmlns:cmp="antlib:org.apache.ant.compress"/&gt;

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/ivy.xml
----------------------------------------------------------------------
diff --git a/ivy.xml b/ivy.xml
index 9c3148d..c614585 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -59,6 +59,7 @@
     <dependency org="org.apache.commons" name="commons-compress" rev="1.16" conf="default"/>
     <dependency org="org.tukaani" name="xz" rev="1.8" conf="default"/>
     <dependency org="org.brotli" name="dec" rev="0.1.2" conf="default"/>
+    <dependency org="com.github.luben" name="zstd-jni" rev="1.3.3-1" conf="default"/>
     <dependency org="junit" name="junit" rev="4.12" conf="test->default"/>
     <dependency org="org.apache.ant" name="ant-antunit" rev="1.3"
                 conf="test->default" transitive="false"  />

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/main/org/apache/ant/compress/antlib.xml
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/antlib.xml b/src/main/org/apache/ant/compress/antlib.xml
index 027b28b..91b9435 100644
--- a/src/main/org/apache/ant/compress/antlib.xml
+++ b/src/main/org/apache/ant/compress/antlib.xml
@@ -105,6 +105,10 @@
      classname="org.apache.ant.compress.taskdefs.UnZ"
      />
   <taskdef
+     name="unzstd"
+     classname="org.apache.ant.compress.taskdefs.UnZstd"
+     />
+  <taskdef
      name="bzip2"
      classname="org.apache.ant.compress.taskdefs.BZip2"
      />
@@ -144,6 +148,10 @@
      name="lzma"
      classname="org.apache.ant.compress.taskdefs.LZMA"
      />
+  <taskdef
+     name="zstd"
+     classname="org.apache.ant.compress.taskdefs.Zstd"
+     />
 
   <typedef
      name="arentry"
@@ -250,6 +258,10 @@
      name="zresource"
      classname="org.apache.ant.compress.resources.ZResource"
      />
+  <typedef
+     name="zstdresource"
+     classname="org.apache.ant.compress.resources.ZstdResource"
+     />
 
   <componentdef
      name="hasusername"

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/main/org/apache/ant/compress/resources/ZstdResource.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/resources/ZstdResource.java b/src/main/org/apache/ant/compress/resources/ZstdResource.java
new file mode 100644
index 0000000..be30719
--- /dev/null
+++ b/src/main/org/apache/ant/compress/resources/ZstdResource.java
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ant.compress.resources;
+
+import org.apache.ant.compress.util.ZstdStreamFactory;
+import org.apache.tools.ant.types.ResourceCollection;
+
+/**
+ * A Zstdandard compressed resource.
+ * @since Apache Compress Antlib 1.6
+ */
+public final class ZstdResource extends CommonsCompressCompressorResource {
+    private static final String NAME = "ZSTD";
+
+    public ZstdResource() {
+        super(NAME, new ZstdStreamFactory());
+    }
+
+    public ZstdResource(ResourceCollection other) {
+        super(NAME, new ZstdStreamFactory(), other);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/main/org/apache/ant/compress/taskdefs/UnZstd.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/taskdefs/UnZstd.java b/src/main/org/apache/ant/compress/taskdefs/UnZstd.java
new file mode 100644
index 0000000..c23d31a
--- /dev/null
+++ b/src/main/org/apache/ant/compress/taskdefs/UnZstd.java
@@ -0,0 +1,33 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.compress.taskdefs;
+
+import org.apache.ant.compress.util.ZstdStreamFactory;
+
+/**
+ * Expands a Zstandard archive.
+ * @since Apache Compress Antlib 1.6
+ */
+public final class UnZstd extends UnpackBase {
+
+    public UnZstd() {
+        super(".zstd", new ZstdStreamFactory());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/main/org/apache/ant/compress/taskdefs/Zstd.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/taskdefs/Zstd.java b/src/main/org/apache/ant/compress/taskdefs/Zstd.java
new file mode 100644
index 0000000..1cea2ee
--- /dev/null
+++ b/src/main/org/apache/ant/compress/taskdefs/Zstd.java
@@ -0,0 +1,42 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.compress.taskdefs;
+
+import org.apache.ant.compress.resources.CommonsCompressCompressorResource;
+import org.apache.ant.compress.resources.ZstdResource;
+import org.apache.ant.compress.util.ZstdStreamFactory;
+import org.apache.tools.ant.types.Resource;
+
+/**
+ * Compresses using Zstandard.
+ * @since Apache Compress Antlib 1.6
+ */
+public final class Zstd extends PackBase {
+
+    public Zstd() {
+        super(new ZstdStreamFactory(),
+              new PackBase.ResourceWrapper() {
+                @Override
+                public CommonsCompressCompressorResource wrap(Resource dest) {
+                    return new ZstdResource(dest);
+                }
+            });
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/main/org/apache/ant/compress/util/ZstdStreamFactory.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/ant/compress/util/ZstdStreamFactory.java b/src/main/org/apache/ant/compress/util/ZstdStreamFactory.java
new file mode 100644
index 0000000..0306269
--- /dev/null
+++ b/src/main/org/apache/ant/compress/util/ZstdStreamFactory.java
@@ -0,0 +1,53 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.ant.compress.util;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.compressors.CompressorInputStream;
+import org.apache.commons.compress.compressors.CompressorOutputStream;
+import org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream;
+import org.apache.commons.compress.compressors.zstandard.ZstdCompressorOutputStream;
+
+/**
+ * Creates streams for the Zstandard format.
+ * @since Apache Compress Antlib 1.6
+ */
+public class ZstdStreamFactory implements CompressorStreamFactory {
+
+    /**
+     * @param stream the stream to read from, should be buffered
+     */
+    @Override
+    public CompressorInputStream getCompressorStream(InputStream stream)
+        throws IOException {
+        return new ZstdCompressorInputStream(stream);
+    }
+
+    /**
+     * @param stream the stream to write to, should be buffered
+     */
+    @Override
+    public CompressorOutputStream getCompressorStream(OutputStream stream)
+        throws IOException {
+        return new ZstdCompressorOutputStream(stream);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/tests/antunit/unzstd-test.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/unzstd-test.xml b/src/tests/antunit/unzstd-test.xml
new file mode 100644
index 0000000..af7a041
--- /dev/null
+++ b/src/tests/antunit/unzstd-test.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<project default="antunit"
+         xmlns:au="antlib:org.apache.ant.antunit"
+         xmlns:cond="antlib:org.apache.tools.ant.types.conditions"
+         xmlns:cmp="antlib:org.apache.ant.compress">
+
+  <import file="antunit-base.xml" />
+
+  <target name="setUp">
+    <mkdir dir="${output}"/>
+  </target>
+
+  <target name="test1">
+    <au:expectfailure>
+      <cmp:unzstd/>
+    </au:expectfailure>
+  </target>
+
+  <target name="test2">
+    <au:expectfailure>
+      <cmp:unzstd src=""/>
+    </au:expectfailure>
+  </target>
+
+  <target name="testZstdTask" depends="setUp">
+    <cmp:zstd src="../resources/asf-logo.gif"
+            destfile="${output}/asf-logo.gif.zstd"/>
+    <cmp:unzstd src="${output}/asf-logo.gif.zstd" dest="${output}/asf-logo.gif" />
+    <au:assertFilesMatch expected="../resources/asf-logo.gif"
+                         actual="${output}/asf-logo.gif"/>
+  </target>
+
+  <target name="testNativeZstd" depends="setUp">
+    <cmp:unzstd src="../resources/asf-logo.gif.zstd"
+                dest="${output}/asf-logo.gif" />
+    <au:assertFilesMatch expected="../resources/asf-logo.gif"
+                         actual="${output}/asf-logo.gif"/>
+  </target>
+
+  <target name="testWithResource" depends="setUp">
+    <cmp:unzstd dest="${output}/asf-logo.gif">
+      <file file="../resources/asf-logo.gif.zstd"/>
+    </cmp:unzstd>
+    <au:assertFilesMatch expected="../resources/asf-logo.gif"
+                         actual="${output}/asf-logo.gif"/>
+  </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/tests/antunit/zstd-test.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/zstd-test.xml b/src/tests/antunit/zstd-test.xml
new file mode 100644
index 0000000..9045411
--- /dev/null
+++ b/src/tests/antunit/zstd-test.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+  -->
+<project default="antunit"
+         xmlns:au="antlib:org.apache.ant.antunit"
+         xmlns:cond="antlib:org.apache.tools.ant.types.conditions"
+         xmlns:cmp="antlib:org.apache.ant.compress">
+
+  <import file="antunit-base.xml" />
+
+  <target name="setUp">
+    <mkdir dir="${output}" />
+    <mkdir dir="${output}/empty" />
+    <touch file="${output}/fileone" />
+    <touch file="${output}/filetwo" />
+  </target>
+
+  <target name="testFailNone" depends="setUp">
+    <au:expectfailure expectedmessage="source is required.">
+      <cmp:zstd destfile="${output}/file.zstd">
+        <fileset dir="${output}/empty" />
+      </cmp:zstd>
+    </au:expectfailure>
+  </target>
+
+  <target name="testFailTwo" depends="setUp">
+    <au:expectfailure expectedmessage="Can only have one source.">
+      <cmp:zstd destfile="${output}/file.zstd">
+        <fileset dir="${output}" />
+      </cmp:zstd>
+    </au:expectfailure>
+  </target>
+
+  <target name="testFailNoDest" depends="setUp">
+    <au:expectfailure expectedmessage="dest resource is required.">
+      <cmp:zstd src="${output}/fileone">
+        <dest>
+          <fileset dir="${output}/empty" />
+        </dest>
+      </cmp:zstd>
+    </au:expectfailure>
+  </target>
+
+  <target name="testFailTwoDests" depends="setUp">
+    <au:expectfailure expectedmessage="Can only have one destination resource.">
+      <cmp:zstd src="${output}/fileone">
+        <dest>
+          <fileset dir="${output}" />
+        </dest>
+      </cmp:zstd>
+    </au:expectfailure>
+  </target>
+
+  <target name="testRealTest" depends="setUp">
+    <cmp:zstd src="../resources/asf-logo.gif"
+              destfile="${output}/asf-logo.gif.zstd" />
+    <au:assertLogContains text="Building: asf-logo.gif.zstd"/>
+    <au:assertFileExists file="${output}/asf-logo.gif.zstd"/>
+  </target>
+
+  <target name="testRealTestWithResource" depends="setUp">
+    <cmp:zstd destfile="${output}/asf-logo.gif.zstd">
+      <file file="../resources/asf-logo.gif"/>
+    </cmp:zstd>
+    <au:assertLogContains text="Building: asf-logo.gif.zstd"/>
+    <au:assertFileExists file="${output}/asf-logo.gif.zstd"/>
+  </target>
+
+  <target name="testDateCheck" depends="setUp">
+    <touch file="${output}/asf-logo.gif.zstd"/>
+    <cmp:zstd src="../resources/asf-logo.gif"
+              destfile="${output}/asf-logo.gif.zstd" />
+    <au:assertLogContains text="Nothing to do: asf-logo.gif.zstd is up to date."/>
+  </target>
+
+  <target name="testNestedTask" depends="setUp">
+    <cmp:zstd destfile="${output}/asf-logo.tar.zstd">
+      <cmp:tar>
+        <cmp:cpiofileset src="../resources/asf-logo.gif.bin.cpio"
+                         includes="asf-logo.gif"/>
+      </cmp:tar>
+    </cmp:zstd>
+    <au:assertFileExists file="${output}/asf-logo.tar.zstd"/>
+    <au:assertTrue>
+      <cond:islastmodified datetime="2009-07-31-20:11:13 +0200"
+                           pattern="yyyy-MM-dd-HH:mm:ss Z">
+        <cmp:tarentry name="asf-logo.gif">
+          <cmp:zstdresource>
+            <file file="${output}/asf-logo.tar.zstd"/>
+          </cmp:zstdresource>
+        </cmp:tarentry>
+      </cond:islastmodified>
+    </au:assertTrue>
+  </target>
+</project>

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/tests/antunit/zstdresource-test.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/zstdresource-test.xml b/src/tests/antunit/zstdresource-test.xml
new file mode 100644
index 0000000..2f5f601
--- /dev/null
+++ b/src/tests/antunit/zstdresource-test.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<project default="antunit"
+         xmlns:au="antlib:org.apache.ant.antunit"
+         xmlns:cond="antlib:org.apache.tools.ant.types.conditions"
+         xmlns:cmp="antlib:org.apache.ant.compress">
+
+  <import file="antunit-base.xml" />
+
+  <target name="setUp">
+    <mkdir dir="${output}"/>
+  </target>
+
+  <target name="testNativeZstd" depends="setUp">
+    <copy todir="${output}">
+      <cmp:zstdresource>
+        <file file="../resources/asf-logo.gif.zstd"/>
+      </cmp:zstdresource>
+      <globmapper from="*.zstd" to="*"/>
+    </copy>
+    <au:assertFilesMatch expected="../resources/asf-logo.gif"
+                         actual="${output}/asf-logo.gif"/>
+  </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/d282fff1/src/tests/resources/asf-logo.gif.zstd
----------------------------------------------------------------------
diff --git a/src/tests/resources/asf-logo.gif.zstd b/src/tests/resources/asf-logo.gif.zstd
new file mode 100644
index 0000000..32a4750
Binary files /dev/null and b/src/tests/resources/asf-logo.gif.zstd differ


[4/5] ant-antlibs-compress git commit: make project description more current

Posted by bo...@apache.org.
make project description more current


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/9aa28d98
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/9aa28d98
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/9aa28d98

Branch: refs/heads/master
Commit: 9aa28d9846c5c96365fde414698a668b0e8e20b5
Parents: d282fff
Author: Stefan Bodewig <bo...@apache.org>
Authored: Tue Feb 6 21:46:38 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Tue Feb 6 21:46:38 2018 +0100

----------------------------------------------------------------------
 project-template.pom | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/9aa28d98/project-template.pom
----------------------------------------------------------------------
diff --git a/project-template.pom b/project-template.pom
index b2a1174..f3f7dc1 100644
--- a/project-template.pom
+++ b/project-template.pom
@@ -26,10 +26,10 @@
   <name>Apache Compress Antlib</name>
   <url>http://ant.apache.org/antlibs/compress/</url>
   <description>
-    Provides tasks and types that deal with AR, ARJ, CPIO, TAR,
-    DUMP, 7Z and ZIP archives as well as BZIP2, PACK200, GZIP, LZMA,
-    Snappy, LZ4, Brotli and XZ compressed files based on Apache
-    Commons Compress.
+    Provides tasks and types that deal with AR, ARJ, CPIO, TAR, DUMP,
+    7Z and ZIP archives as well as BZIP2, PACK200, GZIP, LZMA, Snappy,
+    LZ4, Brotli, DEFLATE, DEFLATE64, Zstandard, Unix compress and XZ
+    compressed files based on Apache Commons Compress.
   </description>
   <licenses>
     <license>


[5/5] ant-antlibs-compress git commit: update versions in POM as well

Posted by bo...@apache.org.
update versions in POM as well


Project: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/commit/2cb68135
Tree: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/tree/2cb68135
Diff: http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/diff/2cb68135

Branch: refs/heads/master
Commit: 2cb681358beb2d7c2fdf51ecbfdb2bd11fffe0fc
Parents: 9aa28d9
Author: Stefan Bodewig <bo...@apache.org>
Authored: Tue Feb 6 21:47:51 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Tue Feb 6 21:47:51 2018 +0100

----------------------------------------------------------------------
 project-template.pom | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-antlibs-compress/blob/2cb68135/project-template.pom
----------------------------------------------------------------------
diff --git a/project-template.pom b/project-template.pom
index f3f7dc1..7d05426 100644
--- a/project-template.pom
+++ b/project-template.pom
@@ -51,12 +51,18 @@
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-compress</artifactId>
-      <version>1.14</version>
+      <version>1.16</version>
     </dependency>
     <dependency>
       <groupId>org.tukaani</groupId>
       <artifactId>xz</artifactId>
-      <version>1.6</version>
+      <version>1.8</version>
+    </dependency>
+    <dependency>
+      <groupId>com.github.luben</groupId>
+      <artifactId>zstd-jni</artifactId>
+      <version>1.3.3-1</version>
+      <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>org.brotli</groupId>