git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269684 13f79535-47bb-0310-9956-ffa450edef68master
@@ -7,6 +7,9 @@ Changes that could break older environments: | |||||
Other changes: | Other changes: | ||||
-------------- | -------------- | ||||
* The attributes zipfile, jarfile and warfile (from the Zip, Jar and War tasks) | |||||
have been deprecated and supersceded by a new attribute "file". | |||||
Fixed bugs: | Fixed bugs: | ||||
----------- | ----------- | ||||
@@ -56,7 +56,7 @@ include an empty one for you.)</p> | |||||
<td align="center" valign="top"><b>Required</b></td> | <td align="center" valign="top"><b>Required</b></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">jarfile</td> | |||||
<td valign="top">file</td> | |||||
<td valign="top">the jar-file to create.</td> | <td valign="top">the jar-file to create.</td> | ||||
<td valign="top" align="center">Yes</td> | <td valign="top" align="center">Yes</td> | ||||
</tr> | </tr> | ||||
@@ -138,17 +138,17 @@ end up in the <code>META-INF</code> directory of the jar file. If this | |||||
fileset includes a file named <code>MANIFEST.MF</code>, the file is | fileset includes a file named <code>MANIFEST.MF</code>, the file is | ||||
ignored and you will get a warning.</p> | ignored and you will get a warning.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<pre> <jar jarfile="${dist}/lib/app.jar" basedir="${build}/classes"/></pre> | |||||
<pre> <jar file="${dist}/lib/app.jar" basedir="${build}/classes"/></pre> | |||||
<p>jars all files in the <code>${build}/classes</code> directory into a file | <p>jars all files in the <code>${build}/classes</code> directory into a file | ||||
called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p> | called <code>app.jar</code> in the <code>${dist}/lib</code> directory.</p> | ||||
<pre> <jar jarfile="${dist}/lib/app.jar" | |||||
<pre> <jar file="${dist}/lib/app.jar" | |||||
basedir="${build}/classes" | basedir="${build}/classes" | ||||
excludes="**/Test.class" | excludes="**/Test.class" | ||||
/></pre> | /></pre> | ||||
<p>jars all files in the <code>${build}/classes</code> directory into a file | <p>jars all files in the <code>${build}/classes</code> directory into a file | ||||
called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files | called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Files | ||||
with the name <code>Test.class</code> are excluded.</p> | with the name <code>Test.class</code> are excluded.</p> | ||||
<pre> <jar jarfile="${dist}/lib/app.jar" | |||||
<pre> <jar file="${dist}/lib/app.jar" | |||||
basedir="${build}/classes" | basedir="${build}/classes" | ||||
includes="mypackage/test/**" | includes="mypackage/test/**" | ||||
excludes="**/Test.class" | excludes="**/Test.class" | ||||
@@ -157,7 +157,7 @@ with the name <code>Test.class</code> are excluded.</p> | |||||
called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Only | called <code>app.jar</code> in the <code>${dist}/lib</code> directory. Only | ||||
files under the directory <code>mypackage/test</code> are used, and files with | files under the directory <code>mypackage/test</code> are used, and files with | ||||
the name <code>Test.class</code> are excluded.</p> | the name <code>Test.class</code> are excluded.</p> | ||||
<pre> <jar jarfile="${dist}/lib/app.jar"> | |||||
<pre> <jar file="${dist}/lib/app.jar"> | |||||
<fileset dir="${build}/classes" | <fileset dir="${build}/classes" | ||||
excludes="**/Test.class" | excludes="**/Test.class" | ||||
/> | /> | ||||
@@ -26,7 +26,7 @@ attributes of zipfilesets in a Zip or Jar task.)</p> | |||||
<td align="center" valign="top"><b>Required</b></td> | <td align="center" valign="top"><b>Required</b></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">warfile</td> | |||||
<td valign="top">file</td> | |||||
<td valign="top">the war-file to create.</td> | <td valign="top">the war-file to create.</td> | ||||
<td valign="top" align="center">Yes</td> | <td valign="top" align="center">Yes</td> | ||||
</tr> | </tr> | ||||
@@ -140,7 +140,7 @@ src/graphics/images/gifs/large/logo.gif | |||||
</pre> | </pre> | ||||
then the war file <code>myapp.war</code> created with | then the war file <code>myapp.war</code> created with | ||||
<pre> | <pre> | ||||
<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/html/myapp"/> | ||||
<fileset dir="src/jsp/myapp"/> | <fileset dir="src/jsp/myapp"/> | ||||
<lib dir="thirdparty/libs"> | <lib dir="thirdparty/libs"> | ||||
@@ -57,7 +57,7 @@ Java.</p> | |||||
<td valign="top" align="center"><b>Required</b></td> | <td valign="top" align="center"><b>Required</b></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">zipfile</td> | |||||
<td valign="top">file</td> | |||||
<td valign="top">the zip-file to create.</td> | <td valign="top">the zip-file to create.</td> | ||||
<td align="center" valign="top">Yes</td> | <td align="center" valign="top">Yes</td> | ||||
</tr> | </tr> | ||||
@@ -142,12 +142,12 @@ contents will be extracted and included in the archive. As with directories, in | |||||
for inclusion in the archive.</p> | for inclusion in the archive.</p> | ||||
<h3>Examples</h3> | <h3>Examples</h3> | ||||
<pre> <zip zipfile="${dist}/manual.zip" | |||||
<pre> <zip file="${dist}/manual.zip" | |||||
basedir="htdocs/manual" | basedir="htdocs/manual" | ||||
/></pre> | /></pre> | ||||
<p>zips all files in the <code>htdocs/manual</code> directory into a file called <code>manual.zip</code> | <p>zips all files in the <code>htdocs/manual</code> directory into a file called <code>manual.zip</code> | ||||
in the <code>${dist}</code> directory.</p> | in the <code>${dist}</code> directory.</p> | ||||
<pre> <zip zipfile="${dist}/manual.zip" | |||||
<pre> <zip file="${dist}/manual.zip" | |||||
basedir="htdocs/manual" | basedir="htdocs/manual" | ||||
update="true" | update="true" | ||||
/></pre> | /></pre> | ||||
@@ -155,27 +155,27 @@ in the <code>${dist}</code> directory.</p> | |||||
in the <code>${dist}</code> directory. If <code>manual.zip</code> | in the <code>${dist}</code> directory. If <code>manual.zip</code> | ||||
doesn't exist, it is created; otherwise it is updated with the | doesn't exist, it is created; otherwise it is updated with the | ||||
new/changed files.</p> | new/changed files.</p> | ||||
<pre> <zip zipfile="${dist}/manual.zip" | |||||
<pre> <zip file="${dist}/manual.zip" | |||||
basedir="htdocs/manual" | basedir="htdocs/manual" | ||||
excludes="mydocs/**, **/todo.html" | excludes="mydocs/**, **/todo.html" | ||||
/></pre> | /></pre> | ||||
<p>zips all files in the <code>htdocs/manual</code> directory. Files in the directory <code>mydocs</code>, | <p>zips all files in the <code>htdocs/manual</code> directory. Files in the directory <code>mydocs</code>, | ||||
or files with the name <code>todo.html</code> are excluded.</p> | or files with the name <code>todo.html</code> are excluded.</p> | ||||
<pre> <zip zipfile="${dist}/manual.zip" | |||||
<pre> <zip file="${dist}/manual.zip" | |||||
basedir="htdocs/manual" | basedir="htdocs/manual" | ||||
includes="api/**/*.html" | includes="api/**/*.html" | ||||
excludes="**/todo.html" | excludes="**/todo.html" | ||||
/></pre> | /></pre> | ||||
<p>zips all files in the <code>htdocs/manual</code> directory. Only html files under the directory <code>api</code> | <p>zips all files in the <code>htdocs/manual</code> directory. Only html files under the directory <code>api</code> | ||||
are zipped, and files with the name <code>todo.html</code> are excluded.</p> | are zipped, and files with the name <code>todo.html</code> are excluded.</p> | ||||
<pre> <zip zipfile="${dist}/manual.zip"> | |||||
<pre> <zip file="${dist}/manual.zip"> | |||||
<fileset dir="htdocs/manual"/> | <fileset dir="htdocs/manual"/> | ||||
<fileset dir="." includes="ChangeLog.txt"/> | <fileset dir="." includes="ChangeLog.txt"/> | ||||
</zip></pre> | </zip></pre> | ||||
<p>zips all files in the <code>htdocs/manual</code> directory, and also adds the file <code>ChangeLog.txt</code> in the | <p>zips all files in the <code>htdocs/manual</code> directory, and also adds the file <code>ChangeLog.txt</code> in the | ||||
current directory. <code>ChangeLog.txt</code> will be added to the top of the ZIP file, just as if | current directory. <code>ChangeLog.txt</code> will be added to the top of the ZIP file, just as if | ||||
it had been located at <code>htdocs/manual/ChangeLog.txt</code>.</p> | it had been located at <code>htdocs/manual/ChangeLog.txt</code>.</p> | ||||
<pre> <zip zipfile="${dist}/manual.zip"> | |||||
<pre> <zip file="${dist}/manual.zip"> | |||||
<zipfileset dir="htdocs/manual" prefix="docs/user-guide"/> | <zipfileset dir="htdocs/manual" prefix="docs/user-guide"/> | ||||
<zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/> | <zipfileset dir="." includes="ChangeLog27.txt" fullpath="docs/ChangeLog.txt"/> | ||||
<zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/> | <zipfileset src="examples.zip" includes="**/*.html" prefix="docs/examples"/> | ||||
@@ -83,7 +83,8 @@ public class Jar extends Zip { | |||||
} | } | ||||
public void setJarfile(File jarFile) { | 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 { | public void addConfiguredManifest(Manifest newManifest) throws ManifestException { | ||||
@@ -78,7 +78,8 @@ public class War extends Jar { | |||||
} | } | ||||
public void setWarfile(File warFile) { | 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) { | public void setWebxml(File descr) { | ||||
@@ -102,9 +102,22 @@ public class Zip extends MatchingTask { | |||||
/** | /** | ||||
* This is the name/location of where to | * This is the name/location of where to | ||||
* create the .zip file. | * create the .zip file. | ||||
* | |||||
* @deprecated Use setFile() instead | |||||
*/ | */ | ||||
public void setZipfile(File zipFile) { | 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; | |||||
} | } | ||||
/** | /** | ||||