Browse Source

Unify the attribute of the archive to "file" rather than having three separate attributes (zipfile, jarfile and warfile).

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269684 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
16e0c28649
7 changed files with 35 additions and 17 deletions
  1. +3
    -0
      WHATSNEW
  2. +5
    -5
      docs/manual/CoreTasks/jar.html
  3. +2
    -2
      docs/manual/CoreTasks/war.html
  4. +7
    -7
      docs/manual/CoreTasks/zip.html
  5. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Jar.java
  6. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/War.java
  7. +14
    -1
      src/main/org/apache/tools/ant/taskdefs/Zip.java

+ 3
- 0
WHATSNEW View File

@@ -7,6 +7,9 @@ Changes that could break older environments:
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:
-----------



+ 5
- 5
docs/manual/CoreTasks/jar.html View File

@@ -56,7 +56,7 @@ include an empty one for you.)</p>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">jarfile</td>
<td valign="top">file</td>
<td valign="top">the jar-file to create.</td>
<td valign="top" align="center">Yes</td>
</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
ignored and you will get a warning.</p>
<h3>Examples</h3>
<pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot;/&gt;</pre>
<pre> &lt;jar file=&quot;${dist}/lib/app.jar&quot; basedir=&quot;${build}/classes&quot;/&gt;</pre>
<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>
<pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;
<pre> &lt;jar file=&quot;${dist}/lib/app.jar&quot;
basedir=&quot;${build}/classes&quot;
excludes=&quot;**/Test.class&quot;
/&gt;</pre>
<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
with the name <code>Test.class</code> are excluded.</p>
<pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;
<pre> &lt;jar file=&quot;${dist}/lib/app.jar&quot;
basedir=&quot;${build}/classes&quot;
includes=&quot;mypackage/test/**&quot;
excludes=&quot;**/Test.class&quot;
@@ -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
files under the directory <code>mypackage/test</code> are used, and files with
the name <code>Test.class</code> are excluded.</p>
<pre> &lt;jar jarfile=&quot;${dist}/lib/app.jar&quot;&gt;
<pre> &lt;jar file=&quot;${dist}/lib/app.jar&quot;&gt;
&lt;fileset dir=&quot;${build}/classes&quot;
excludes=&quot;**/Test.class&quot;
/&gt;


+ 2
- 2
docs/manual/CoreTasks/war.html View File

@@ -26,7 +26,7 @@ attributes of zipfilesets in a Zip or Jar task.)</p>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">warfile</td>
<td valign="top">file</td>
<td valign="top">the war-file to create.</td>
<td valign="top" align="center">Yes</td>
</tr>
@@ -140,7 +140,7 @@ src/graphics/images/gifs/large/logo.gif
</pre>
then the war file <code>myapp.war</code> created with
<pre>
&lt;war warfile=&quot;myapp.war&quot; webxml=&quot;src/metadata/myapp.xml&quot;&gt;
&lt;war file=&quot;myapp.war&quot; webxml=&quot;src/metadata/myapp.xml&quot;&gt;
&lt;fileset dir=&quot;src/html/myapp&quot;/&gt;
&lt;fileset dir=&quot;src/jsp/myapp&quot;/&gt;
&lt;lib dir=&quot;thirdparty/libs&quot;&gt;


+ 7
- 7
docs/manual/CoreTasks/zip.html View File

@@ -57,7 +57,7 @@ Java.</p>
<td valign="top" align="center"><b>Required</b></td>
</tr>
<tr>
<td valign="top">zipfile</td>
<td valign="top">file</td>
<td valign="top">the zip-file to create.</td>
<td align="center" valign="top">Yes</td>
</tr>
@@ -142,12 +142,12 @@ contents will be extracted and included in the archive. As with directories, in
for inclusion in the archive.</p>

<h3>Examples</h3>
<pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
<pre> &lt;zip file=&quot;${dist}/manual.zip&quot;
basedir=&quot;htdocs/manual&quot;
/&gt;</pre>
<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>
<pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
<pre> &lt;zip file=&quot;${dist}/manual.zip&quot;
basedir=&quot;htdocs/manual&quot;
update=&quot;true&quot;
/&gt;</pre>
@@ -155,27 +155,27 @@ in the <code>${dist}</code> directory.</p>
in the <code>${dist}</code> directory. If <code>manual.zip</code>
doesn't exist, it is created; otherwise it is updated with the
new/changed files.</p>
<pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
<pre> &lt;zip file=&quot;${dist}/manual.zip&quot;
basedir=&quot;htdocs/manual&quot;
excludes=&quot;mydocs/**, **/todo.html&quot;
/&gt;</pre>
<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>
<pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;
<pre> &lt;zip file=&quot;${dist}/manual.zip&quot;
basedir=&quot;htdocs/manual&quot;
includes=&quot;api/**/*.html&quot;
excludes=&quot;**/todo.html&quot;
/&gt;</pre>
<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>
<pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;&gt;
<pre> &lt;zip file=&quot;${dist}/manual.zip&quot;&gt;
&lt;fileset dir=&quot;htdocs/manual&quot;/&gt;
&lt;fileset dir=&quot;.&quot; includes=&quot;ChangeLog.txt&quot;/&gt;
&lt;/zip&gt;</pre>
<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
it had been located at <code>htdocs/manual/ChangeLog.txt</code>.</p>
<pre> &lt;zip zipfile=&quot;${dist}/manual.zip&quot;&gt;
<pre> &lt;zip file=&quot;${dist}/manual.zip&quot;&gt;
&lt;zipfileset dir=&quot;htdocs/manual&quot; prefix=&quot;docs/user-guide&quot;/&gt;
&lt;zipfileset dir=&quot;.&quot; includes=&quot;ChangeLog27.txt&quot; fullpath=&quot;docs/ChangeLog.txt&quot;/&gt;
&lt;zipfileset src=&quot;examples.zip&quot; includes=&quot;**/*.html&quot; prefix=&quot;docs/examples&quot;/&gt;


+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/Jar.java View File

@@ -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 {


+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/War.java View File

@@ -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) {


+ 14
- 1
src/main/org/apache/tools/ant/taskdefs/Zip.java View File

@@ -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;
}
/**


Loading…
Cancel
Save