From d65cafdcec6ec01247f9b3ce23016ac814d6e125 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Fri, 1 Feb 2002 07:34:34 +0000 Subject: [PATCH] adding destFile naming scheme to tar, for consistency with the zip family and other tasks. I know Costin thinks we do this deliberately, just to break his builds, so even though I have updated the manual and the test cases, I have commented out the deprecated message which users should get when they use the tarfile attribute. Which means old builds still work, but the old params are no longer documented for new users. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271035 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 4 ++-- docs/manual/CoreTasks/tar.html | 6 +++--- src/etc/testcases/taskdefs/tar.xml | 8 ++++---- src/main/org/apache/tools/ant/taskdefs/Tar.java | 11 +++++++++++ 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/build.xml b/build.xml index ef3bfa16d..23b5acff3 100644 --- a/build.xml +++ b/build.xml @@ -604,7 +604,7 @@ basedir="${dist.name}/.." includes="${dist.name}/**"/> + destfile="${dist.base}/bin/${dist.name}-bin.tar"> @@ -634,7 +634,7 @@ basedir="${dist.name}/.." includes="${dist.name}/**"/> + destfile="${dist.base}/src/${dist.name}-src.tar" > diff --git a/docs/manual/CoreTasks/tar.html b/docs/manual/CoreTasks/tar.html index 80b9c6164..abf0733c3 100644 --- a/docs/manual/CoreTasks/tar.html +++ b/docs/manual/CoreTasks/tar.html @@ -52,7 +52,7 @@ the limit.

Required - tarfile + destfile the tar-file to create. Yes @@ -138,7 +138,7 @@ attributes

tars all files in the htdocs/manual directory into a file called manual.tar in the ${dist} directory, then applies the gzip task to compress it.

-
  <tar tarfile="${dist}/manual.tar"
+
  <tar destfile="${dist}/manual.tar"
        basedir="htdocs/manual"
        excludes="mydocs/**, **/todo.html"
   />
@@ -147,7 +147,7 @@ in the ${dist} directory. Files in the directory mydocstodo.html are excluded.

<tar longfile="gnu"
-     tarfile="${dist.base}/${dist.name}-src.tar" >
+     destfile="${dist.base}/${dist.name}-src.tar" >
   <tarfileset dir="${dist.name}/.." mode="755" username="ant" group="ant">
     <include name="${dist.name}/bootstrap.sh"/>
     <include name="${dist.name}/build.sh"/>
diff --git a/src/etc/testcases/taskdefs/tar.xml b/src/etc/testcases/taskdefs/tar.xml
index adc9ef582..ea31a9a85 100644
--- a/src/etc/testcases/taskdefs/tar.xml
+++ b/src/etc/testcases/taskdefs/tar.xml
@@ -16,19 +16,19 @@
 
   
     
-    
   
 
   
     
-    
   
 
   
-    
+    
   
 
    
@@ -39,7 +39,7 @@
   
 
   
-    
   
diff --git a/src/main/org/apache/tools/ant/taskdefs/Tar.java b/src/main/org/apache/tools/ant/taskdefs/Tar.java
index c9133beaf..15d35b492 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Tar.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Tar.java
@@ -129,11 +129,22 @@ public class Tar extends MatchingTask {
 
     /**
      * This is the name/location of where to create the tar file.
+     * @deprecated for consistency with other tasks, please use setDestFile()
      */
     public void setTarfile(File tarFile) {
+        //log("DEPRECATED - The tarfile attribute is deprecated. Please use the destfile attribute instead.");
         this.tarFile = tarFile;
     }
 
+    /**
+     * Sets the destfile attribute.
+     * @since 1.22 ant 1.5
+     * @param destFile The output of the tar
+     */
+    public void setDestFile(File destFile) {
+       this.tarFile = destFile;
+    }
+
     /**
      * This is the base directory to look in for things to tar.
      */