bodewig 01/04/04 06:35:06
Modified: . WHATSNEW
docs/manual/CoreTasks ear.html jar.html war.html
src/main/org/apache/tools/ant/taskdefs Jar.java
Log:
Add a <metainf> element to <jar>
Revision Changes Path
1.100 +3 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- WHATSNEW 2001/04/04 12:03:45 1.99
+++ WHATSNEW 2001/04/04 13:35:02 1.100
@@ -36,6 +36,9 @@
* <sql> now supports REM comments as well as // and --
+* <jar> now has a nested <metainf> element following the same idea as
+ <war>'s <webinf>.
+
Fixed bugs:
-----------
1.2 +8 -1 jakarta-ant/docs/manual/CoreTasks/ear.html
Index: ear.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/ear.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ear.html 2001/04/03 12:49:54 1.1
+++ ear.html 2001/04/04 13:35:03 1.2
@@ -14,7 +14,7 @@
<p>(The Ear task is a shortcut for specifying the particular layout of a EAR
file.
The same thing can be accomplished by using the <i>prefix</i> and
<i>fullpath</i>
attributes of zipfilesets in a Zip or Jar task.)</p>
-<p>The extended zipfileset element from the zip task (with attributes
<i>prefix</i>, <i>fullpath</i>, and <i>src</i>) is available in the War
task.</p>
+<p>The extended zipfileset element from the zip task (with attributes
<i>prefix</i>, <i>fullpath</i>, and <i>src</i>) is available in the Ear
task.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
@@ -84,6 +84,13 @@
<td valign="top" align="center">No</td>
</tr>
</table>
+<h3>Nested elements</h3>
+<h4>metainf</h4>
+<p>The nested <code>metainf</code> element specifies a <a
+href="../CoreTypes/fileset.html">FileSet</a>. All files included in this
fileset will
+end up in the <code>META-INF</code> directory of the ear file. If this
+fileset includes a file named <code>MANIFEST.MF</code>, the file is
+ignored and you will get a warning.</p>
<h2>Example</h2>
<pre>
<ear earfile="${build.dir}/myapp.ear"
appxml="${src.dir}/metadata/application.xml">
1.3 +7 -0 jakarta-ant/docs/manual/CoreTasks/jar.html
Index: jar.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/jar.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- jar.html 2001/02/13 12:31:51 1.2
+++ jar.html 2001/04/04 13:35:04 1.3
@@ -106,6 +106,13 @@
<td valign="top" align="center">No</td>
</tr>
</table>
+<h3>Nested elements</h3>
+<h4>metainf</h4>
+<p>The nested <code>metainf</code> element specifies a <a
+href="../CoreTypes/fileset.html">FileSet</a>. All files included in this
fileset will
+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> <jar jarfile="${dist}/lib/app.jar"
basedir="${build}/classes"/></pre>
<p>jars all files in the <code>${build}/classes</code> directory into a file
1.3 +6 -0 jakarta-ant/docs/manual/CoreTasks/war.html
Index: war.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/war.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- war.html 2001/02/13 12:31:52 1.2
+++ war.html 2001/04/04 13:35:04 1.3
@@ -101,6 +101,12 @@
end up in the <code>WEB-INF</code> directory of the war file. If this
fileset includes a file named <code>web.xml</code>, the file is
ignored and you will get a warning.</p>
+<h4>metainf</h4>
+<p>The nested <code>metainf</code> element specifies a <a
+href="../CoreTypes/fileset.html">FileSet</a>. All files included in this
fileset will
+end up in the <code>META-INF</code> directory of the war 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>
<p>Assume the following structure in the project's base directory:</p>
<pre>
1.16 +5 -0
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
Index: Jar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Jar.java 2001/01/16 13:16:46 1.15
+++ Jar.java 2001/04/04 13:35:05 1.16
@@ -94,6 +94,11 @@
super.addFileset(fs);
}
+ public void addMetainf(ZipFileSet fs) {
+ // We just set the prefix for this fileset, and pass it up.
+ fs.setPrefix("META-INF/");
+ super.addFileset(fs);
+ }
protected void initZipOutputStream(ZipOutputStream zOut)
throws IOException, BuildException