2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2001-12-12 10:54:08 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2001-12-12 10:54:08 +00:00
|
|
|
<title>Manifest Task</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2><a name="manifest">Manifest</a></h2>
|
|
|
|
<h3>Description</h3>
|
|
|
|
<p>Creates a manifest file.</p>
|
|
|
|
|
|
|
|
<p>This task can be used to write a Manifest file, optionally
|
|
|
|
replacing or updating an existing file.</p>
|
|
|
|
|
2006-07-06 09:00:14 +00:00
|
|
|
|
2004-11-11 17:48:36 +00:00
|
|
|
|
2001-12-12 11:05:34 +00:00
|
|
|
<p>Manifests are processed according to the
|
2004-11-11 17:48:36 +00:00
|
|
|
<a href="http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html">Jar
|
2001-12-12 11:05:34 +00:00
|
|
|
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>
|
|
|
|
|
2006-07-06 09:00:14 +00:00
|
|
|
<p>
|
|
|
|
The Ant team regularly gets complaints that this task in generating invalid
|
|
|
|
manifests. By and large, this is not the case: we believe that we are following
|
|
|
|
the specification to the letter. The usual problem is that some third party
|
|
|
|
manifest reader is not following the same specification as well as they think
|
|
|
|
they should; we cannot generate invalid manifest files just because one
|
|
|
|
single application is broken. J2ME runtimes appear to be particularly troublesome.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
If you find that Ant generates manifests incompatible with your runtime, take
|
|
|
|
a manifest it has built, fix it up however you need and switch to using the <zip>
|
|
|
|
task to create the JAR, feeding in the hand-crafted manifest.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
2004-11-11 17:48:36 +00:00
|
|
|
|
2001-12-12 10:54:08 +00:00
|
|
|
<h3>Parameters</h3>
|
|
|
|
<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">file</td>
|
|
|
|
<td valign="top">the manifest-file to create/update.</td>
|
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">mode</td>
|
2001-12-12 11:05:34 +00:00
|
|
|
<td valign="top">One of "update" or "replace", default is "replace".</td>
|
2001-12-12 10:54:08 +00:00
|
|
|
<td valign="top" align="center">No</td>
|
|
|
|
</tr>
|
2003-03-22 09:39:46 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">encoding</td>
|
|
|
|
<td valign="top">The encoding used to read the existing manifest when updating.</td>
|
|
|
|
<td valign="top" align="center">No, defaults to UTF-8 encoding.</td>
|
|
|
|
</tr>
|
2001-12-12 10:54:08 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<h3>Nested elements</h3>
|
2005-10-22 17:58:42 +00:00
|
|
|
<h4><a name="attribute">attribute</a></h4>
|
2001-12-12 10:54:08 +00:00
|
|
|
<p>One attribute for the manifest file. Those attributes that are
|
|
|
|
not nested into a section will be added to the "Main" section.</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>
|
2007-04-20 06:25:05 +00:00
|
|
|
<td valign="top">the name of the attribute, <br>
|
|
|
|
must match the regexp <tt>[A-Za-z0-9][A-Za-z0-9-_]*</tt>.
|
|
|
|
</td>
|
2001-12-12 10:54:08 +00:00
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">value</td>
|
2002-06-22 23:38:38 +00:00
|
|
|
<td valign="top">the value of the attribute.</td>
|
2001-12-12 10:54:08 +00:00
|
|
|
<td valign="top" align="center">Yes</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<h4>section</h4>
|
|
|
|
<p>A manifest section - you can nest <a
|
|
|
|
href="#attribute">attribute</a> elements into sections.</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>
|
2002-06-22 23:38:38 +00:00
|
|
|
<td valign="top" align="center">No, if omitted it will be assumed
|
2001-12-12 10:54:08 +00:00
|
|
|
to be the main section.</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2001-12-12 11:05:34 +00:00
|
|
|
|
|
|
|
<h3>Examples</h3>
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
<manifest file="MANIFEST.MF">
|
|
|
|
<attribute name="Built-By" value="${user.name}"/>
|
2002-02-19 15:22:55 +00:00
|
|
|
<section name="common">
|
2002-09-04 11:05:19 +00:00
|
|
|
<attribute name="Specification-Title" value="Example"/>
|
|
|
|
<attribute name="Specification-Version" value="${version}"/>
|
|
|
|
<attribute name="Specification-Vendor" value="Example Organization"/>
|
|
|
|
<attribute name="Implementation-Title" value="common"/>
|
|
|
|
<attribute name="Implementation-Version" value="${version} ${TODAY}"/>
|
|
|
|
<attribute name="Implementation-Vendor" value="Example Corp."/>
|
2002-02-19 15:22:55 +00:00
|
|
|
</section>
|
2001-12-12 11:05:34 +00:00
|
|
|
<section name="common/class1.class">
|
|
|
|
<attribute name="Sealed" value="false"/>
|
|
|
|
</section>
|
|
|
|
</manifest>
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p>Creates or replaces the file MANIFEST.MF. Note that the Built-By
|
2002-02-19 15:22:55 +00:00
|
|
|
attribute will take the value of the Ant property ${user.name}. The
|
|
|
|
same is true for the ${version} and ${TODAY} properties. This example
|
|
|
|
produces a MANIFEST.MF that contains
|
2005-10-22 17:58:42 +00:00
|
|
|
<a href="http://java.sun.com/j2se/1.5.0/docs/guide/versioning/">package
|
2002-02-19 15:22:55 +00:00
|
|
|
version identification</a> for the package <code>common</code>.</p>
|
|
|
|
|
|
|
|
<p>The manifest produced by the above would look like this:</p>
|
|
|
|
|
2001-12-12 11:05:34 +00:00
|
|
|
<pre><code>Manifest-Version: 1.0
|
|
|
|
Built-By: bodewig
|
2006-07-06 09:00:14 +00:00
|
|
|
Created-By: Apache Ant 1.7
|
2001-12-12 11:05:34 +00:00
|
|
|
|
2002-02-19 15:22:55 +00:00
|
|
|
Name: common
|
|
|
|
Specification-Title: Example
|
|
|
|
Specification-Vendor: Example Organization
|
|
|
|
Implementation-Vendor: Example Corp.
|
2006-07-06 09:00:14 +00:00
|
|
|
Specification-Version: 1.2
|
|
|
|
Implementation-Version: 1.2 February 19 2006
|
2002-02-19 15:22:55 +00:00
|
|
|
Implementation-Title: common
|
|
|
|
|
2001-12-12 11:05:34 +00:00
|
|
|
Name: common/class1.class
|
2002-02-19 15:22:55 +00:00
|
|
|
Sealed: false
|
|
|
|
|
|
|
|
</code></pre>
|
|
|
|
|
2006-09-11 04:33:25 +00:00
|
|
|
|
2001-12-12 10:54:08 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|