Browse Source

improve documentation of manifest task, using Conor's patch that

caught me mid-flight as a basis.

We really should coordinate from time to time 8-)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270132 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
1eb5ef27e1
2 changed files with 36 additions and 57 deletions
  1. +5
    -56
      docs/manual/CoreTasks/jar.html
  2. +31
    -1
      docs/manual/CoreTasks/manifest.html

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

@@ -137,21 +137,15 @@ fileset includes a file named <code>MANIFEST.MF</code>, the file is
ignored and you will get a warning.</p>

<h4>Manifest</h4>
<p>The manifest nested element allows the manifest for the Jar file to
be provided inline in the build file rather than in an external
file. This element is identical to the
<a href="manifest.html">manifest</a> task, but its file and mode
attributes will be ignored.</p>
<p>
The manifest nested element allows the manifest for the Jar file to be
provided inline in the build file rather than in an external file. This
makes it easy to produce Jar manifests which take values from Ant properties.
If both an inline manifest and an external file are both specified, the
manifests are merged.
</p>
<p>
The manifest element supports nested elements to reflect the structure of
manifests, according to the
<a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html">Jar file
specification</a>. Specifically, a manifest
element consists of a set of attributes and sections. These sections in turn
may contain attributes.
</p>

<p>When using inline manifests, the Jar task will check whether the build
file is more recent that the Jar file when deciding whether to rebuild the
@@ -159,51 +153,6 @@ Jar. This will not take into account property file changes which may affect
the resulting Jar.
</p>

<p> The manifest element itself does not support any attributes. It serves
merely as a container for the attribute and section elements that make up the
manifest. The attributes of those elements are as follows:
</p>
<p>
<b>Section</b>
</p>
<p>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">Name</td>
<td valign="top">The name of the section</td>
<td valign="top" align="center">Yes</td>
</tr>
</table>
</p>

<p>
<b>Attribute</b>
</p>
<p>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
<td valign="top">Name</td>
<td valign="top">The name of the attribute</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
<td valign="top">Value</td>
<td valign="top">The value of the attribute</td>
<td valign="top" align="center">Yes</td>
</tr>
</table>
</p>

<h3>Examples</h3>
<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


+ 31
- 1
docs/manual/CoreTasks/manifest.html View File

@@ -14,6 +14,14 @@
<p>This task can be used to write a Manifest file, optionally
replacing or updating an existing file.</p>

<p>Manifests are processed according to the
<a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html">Jar
file specification.</a>. Specifically, a manifest element consists of
a set of attributes and sections. These sections in turn may contain
attributes. Note in particular that this may result in manifest lines
greater than 72 bytes being wrapped and continued on the next
line.</p>

<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -28,7 +36,7 @@ replacing or updating an existing file.</p>
</tr>
<tr>
<td valign="top">mode</td>
<td valign="top">One of "update" or "replace", default is "update".</td>
<td valign="top">One of "update" or "replace", default is "replace".</td>
<td valign="top" align="center">No</td>
</tr>
</table>
@@ -73,6 +81,28 @@ href="#attribute">attribute</a> elements into sections.</p>
to be the main section.</td>
</tr>
</table>

<h3>Examples</h3>

<pre>
&lt;manifest file=&quot;MANIFEST.MF&quot;&gt;
&lt;attribute name=&quot;Built-By&quot; value=&quot;${user.name}&quot;/&gt;
&lt;section name=&quot;common/class1.class&quot;&gt;
&lt;attribute name=&quot;Sealed&quot; value=&quot;false&quot;/&gt;
&lt;/section&gt;
&lt;/manifest&gt;
</pre>

<p>Creates or replaces the file MANIFEST.MF. Note that the Built-By
attribute will take the value of the Ant property ${user.name}. The
manifest produced by the above would look like this:
</p>
<pre><code>Manifest-Version: 1.0
Built-By: bodewig
Created-By: Apache Ant 1.5alpha

Name: common/class1.class
Sealed: false</code></pre>
</body>
</html>


Loading…
Cancel
Save