From 16e0c2864905cd7709563ef7e38379eff9897455 Mon Sep 17 00:00:00 2001
From: Peter Donald
META-INF
directory of the jar file. If this
fileset includes a file named MANIFEST.MF
, the file is
ignored and you will get a warning.
<jar jarfile="${dist}/lib/app.jar" basedir="${build}/classes"/>+
<jar file="${dist}/lib/app.jar" basedir="${build}/classes"/>
jars all files in the ${build}/classes
directory into a file
called app.jar
in the ${dist}/lib
directory.
<jar jarfile="${dist}/lib/app.jar" +<jar file="${dist}/lib/app.jar" basedir="${build}/classes" excludes="**/Test.class" />jars all files in the
-${build}/classes
directory into a file calledapp.jar
in the${dist}/lib
directory. Files with the nameTest.class
are excluded.<jar jarfile="${dist}/lib/app.jar" +<jar file="${dist}/lib/app.jar" basedir="${build}/classes" includes="mypackage/test/**" excludes="**/Test.class" @@ -157,7 +157,7 @@ with the nameTest.class
are excluded. calledapp.jar
in the${dist}/lib
directory. Only files under the directorymypackage/test
are used, and files with the nameTest.class
are excluded. -<jar jarfile="${dist}/lib/app.jar"> +<jar file="${dist}/lib/app.jar"> <fileset dir="${build}/classes" excludes="**/Test.class" /> diff --git a/docs/manual/CoreTasks/war.html b/docs/manual/CoreTasks/war.html index cee682286..bf5c87d9d 100644 --- a/docs/manual/CoreTasks/war.html +++ b/docs/manual/CoreTasks/war.html @@ -26,7 +26,7 @@ attributes of zipfilesets in a Zip or Jar task.)then the war fileRequired - @@ -140,7 +140,7 @@ src/graphics/images/gifs/large/logo.gifwarfile +file the war-file to create. Yes myapp.war
created with-<war warfile="myapp.war" webxml="src/metadata/myapp.xml"> +<war file="myapp.war" webxml="src/metadata/myapp.xml"> <fileset dir="src/html/myapp"/> <fileset dir="src/jsp/myapp"/> <lib dir="thirdparty/libs"> diff --git a/docs/manual/CoreTasks/zip.html b/docs/manual/CoreTasks/zip.html index f9f7092c4..e070e3147 100644 --- a/docs/manual/CoreTasks/zip.html +++ b/docs/manual/CoreTasks/zip.html @@ -57,7 +57,7 @@ Java.Required - @@ -142,12 +142,12 @@ contents will be extracted and included in the archive. As with directories, in for inclusion in the archive.zipfile +file the zip-file to create. Yes Examples
-<zip zipfile="${dist}/manual.zip" +<zip file="${dist}/manual.zip" basedir="htdocs/manual" />zips all files in the
-htdocs/manual
directory into a file calledmanual.zip
in the${dist}
directory.<zip zipfile="${dist}/manual.zip" +<zip file="${dist}/manual.zip" basedir="htdocs/manual" update="true" />@@ -155,27 +155,27 @@ in the${dist}
directory. in the${dist}
directory. Ifmanual.zip
doesn't exist, it is created; otherwise it is updated with the new/changed files. -<zip zipfile="${dist}/manual.zip" +<zip file="${dist}/manual.zip" basedir="htdocs/manual" excludes="mydocs/**, **/todo.html" />zips all files in the
-htdocs/manual
directory. Files in the directorymydocs
, or files with the nametodo.html
are excluded.<zip zipfile="${dist}/manual.zip" +<zip file="${dist}/manual.zip" basedir="htdocs/manual" includes="api/**/*.html" excludes="**/todo.html" />zips all files in the
-htdocs/manual
directory. Only html files under the directoryapi
are zipped, and files with the nametodo.html
are excluded.<zip zipfile="${dist}/manual.zip"> +<zip file="${dist}/manual.zip"> <fileset dir="htdocs/manual"/> <fileset dir="." includes="ChangeLog.txt"/> </zip>zips all files in the
-htdocs/manual
directory, and also adds the fileChangeLog.txt
in the current directory.ChangeLog.txt
will be added to the top of the ZIP file, just as if it had been located athtdocs/manual/ChangeLog.txt
.<zip zipfile="${dist}/manual.zip"> +<zip file="${dist}/manual.zip"> <zipfileset dir="htdocs/manual" prefix="docs/user-guide"/> <zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/> <zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/> diff --git a/src/main/org/apache/tools/ant/taskdefs/Jar.java b/src/main/org/apache/tools/ant/taskdefs/Jar.java index 2a8e48ff3..0a7a050cb 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Jar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Jar.java @@ -83,7 +83,8 @@ public class Jar extends Zip { } public void setJarfile(File jarFile) { - super.setZipfile(jarFile); + log("DEPRECATED - The jarfile attribute is deprecated. Use file attribute instead."); + super.setFile(jarFile); } public void addConfiguredManifest(Manifest newManifest) throws ManifestException { diff --git a/src/main/org/apache/tools/ant/taskdefs/War.java b/src/main/org/apache/tools/ant/taskdefs/War.java index 7e12d545e..ff2ceed43 100644 --- a/src/main/org/apache/tools/ant/taskdefs/War.java +++ b/src/main/org/apache/tools/ant/taskdefs/War.java @@ -78,7 +78,8 @@ public class War extends Jar { } public void setWarfile(File warFile) { - super.setZipfile(warFile); + log("DEPRECATED - The warfile attribute is deprecated. Use file attribute instead."); + super.setFile(warFile); } public void setWebxml(File descr) { diff --git a/src/main/org/apache/tools/ant/taskdefs/Zip.java b/src/main/org/apache/tools/ant/taskdefs/Zip.java index 7691db47a..4b840c461 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Zip.java +++ b/src/main/org/apache/tools/ant/taskdefs/Zip.java @@ -102,9 +102,22 @@ public class Zip extends MatchingTask { /** * This is the name/location of where to * create the .zip file. + * + * @deprecated Use setFile() instead */ public void setZipfile(File zipFile) { - this.zipFile = zipFile; + log("DEPRECATED - The zipfile attribute is deprecated. Use file attribute instead."); + setFile( zipFile ); + } + + /** + * This is the name/location of where to + * create the .zip file. + * + * @deprecated Use setFile() instead + */ + public void setFile(File file) { + this.zipFile = file; } /**