source: release-kits/lirk3/resources/gs3-release-maker/ant/docs/manual/CoreTasks/manifest.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 4.6 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Manifest Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="manifest">Manifest</a></h2>
12<h3>Description</h3>
13<p>Creates a manifest file.</p>
14
15<p>This task can be used to write a Manifest file, optionally
16replacing or updating an existing file.</p>
17
18<p>Manifests are processed according to the
19<a href="http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html">Jar
20file specification.</a>. Specifically, a manifest element consists of
21a set of attributes and sections. These sections in turn may contain
22attributes. Note in particular that this may result in manifest lines
23greater than 72 bytes being wrapped and continued on the next
24line.</p>
25
26<h3>Parameters</h3>
27<table border="1" cellpadding="2" cellspacing="0">
28 <tr>
29 <td valign="top"><b>Attribute</b></td>
30 <td valign="top"><b>Description</b></td>
31 <td align="center" valign="top"><b>Required</b></td>
32 </tr>
33 <tr>
34 <td valign="top">file</td>
35 <td valign="top">the manifest-file to create/update.</td>
36 <td valign="top" align="center">Yes</td>
37 </tr>
38 <tr>
39 <td valign="top">mode</td>
40 <td valign="top">One of "update" or "replace", default is "replace".</td>
41 <td valign="top" align="center">No</td>
42 </tr>
43 <tr>
44 <td valign="top">encoding</td>
45 <td valign="top">The encoding used to read the existing manifest when updating.</td>
46 <td valign="top" align="center">No, defaults to UTF-8 encoding.</td>
47 </tr>
48</table>
49
50<h3>Nested elements</h3>
51<h4><a name="attribute">attribute</h4></h4>
52<p>One attribute for the manifest file. Those attributes that are
53not nested into a section will be added to the "Main" section.</p>
54<table border="1" cellpadding="2" cellspacing="0">
55 <tr>
56 <td valign="top"><b>Attribute</b></td>
57 <td valign="top"><b>Description</b></td>
58 <td align="center" valign="top"><b>Required</b></td>
59 </tr>
60 <tr>
61 <td valign="top">name</td>
62 <td valign="top">the name of the attribute.</td>
63 <td valign="top" align="center">Yes</td>
64 </tr>
65 <tr>
66 <td valign="top">value</td>
67 <td valign="top">the value of the attribute.</td>
68 <td valign="top" align="center">Yes</td>
69 </tr>
70</table>
71
72
73<h4>section</h4>
74<p>A manifest section - you can nest <a
75href="#attribute">attribute</a> elements into sections.</p>
76
77<table border="1" cellpadding="2" cellspacing="0">
78 <tr>
79 <td valign="top"><b>Attribute</b></td>
80 <td valign="top"><b>Description</b></td>
81 <td align="center" valign="top"><b>Required</b></td>
82 </tr>
83 <tr>
84 <td valign="top">name</td>
85 <td valign="top">the name of the section.</td>
86 <td valign="top" align="center">No, if omitted it will be assumed
87 to be the main section.</td>
88 </tr>
89</table>
90
91<h3>Examples</h3>
92
93<pre>
94 &lt;manifest file=&quot;MANIFEST.MF&quot;&gt;
95 &lt;attribute name=&quot;Built-By&quot; value=&quot;${user.name}&quot;/&gt;
96 &lt;section name=&quot;common&quot;&gt;
97 &lt;attribute name=&quot;Specification-Title&quot; value=&quot;Example&quot;/&gt;
98 &lt;attribute name=&quot;Specification-Version&quot; value=&quot;${version}&quot;/&gt;
99 &lt;attribute name=&quot;Specification-Vendor&quot; value=&quot;Example Organization&quot;/&gt;
100 &lt;attribute name=&quot;Implementation-Title&quot; value=&quot;common&quot;/&gt;
101 &lt;attribute name=&quot;Implementation-Version&quot; value=&quot;${version} ${TODAY}&quot;/&gt;
102 &lt;attribute name=&quot;Implementation-Vendor&quot; value=&quot;Example Corp.&quot;/&gt;
103 &lt;/section&gt;
104 &lt;section name=&quot;common/class1.class&quot;&gt;
105 &lt;attribute name=&quot;Sealed&quot; value=&quot;false&quot;/&gt;
106 &lt;/section&gt;
107 &lt;/manifest&gt;
108</pre>
109
110<p>Creates or replaces the file MANIFEST.MF. Note that the Built-By
111attribute will take the value of the Ant property ${user.name}. The
112same is true for the ${version} and ${TODAY} properties. This example
113produces a MANIFEST.MF that contains
114<a href="http://java.sun.com/products/jdk/1.2/docs/guide/versioning/index.html">package
115version identification</a> for the package <code>common</code>.</p>
116
117<p>The manifest produced by the above would look like this:</p>
118
119<pre><code>Manifest-Version: 1.0
120Built-By: bodewig
121Created-By: Apache Ant 1.5alpha
122
123Name: common
124Specification-Title: Example
125Specification-Vendor: Example Organization
126Implementation-Vendor: Example Corp.
127Specification-Version: 1.1
128Implementation-Version: 1.1 February 19 2002
129Implementation-Title: common
130
131Name: common/class1.class
132Sealed: false
133
134</code></pre>
135
136<hr>
137<p align="center">Copyright &copy; 2001-2004 The Apache Software Foundation. All rights
138Reserved.</p>
139</body>
140</html>
141
Note: See TracBrowser for help on using the repository browser.