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
|
---|
16 | replacing 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
|
---|
20 | file specification.</a>. Specifically, a manifest element consists of
|
---|
21 | a set of attributes and sections. These sections in turn may contain
|
---|
22 | attributes. Note in particular that this may result in manifest lines
|
---|
23 | greater than 72 bytes being wrapped and continued on the next
|
---|
24 | line.</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
|
---|
53 | not 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
|
---|
75 | href="#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 | <manifest file="MANIFEST.MF">
|
---|
95 | <attribute name="Built-By" value="${user.name}"/>
|
---|
96 | <section name="common">
|
---|
97 | <attribute name="Specification-Title" value="Example"/>
|
---|
98 | <attribute name="Specification-Version" value="${version}"/>
|
---|
99 | <attribute name="Specification-Vendor" value="Example Organization"/>
|
---|
100 | <attribute name="Implementation-Title" value="common"/>
|
---|
101 | <attribute name="Implementation-Version" value="${version} ${TODAY}"/>
|
---|
102 | <attribute name="Implementation-Vendor" value="Example Corp."/>
|
---|
103 | </section>
|
---|
104 | <section name="common/class1.class">
|
---|
105 | <attribute name="Sealed" value="false"/>
|
---|
106 | </section>
|
---|
107 | </manifest>
|
---|
108 | </pre>
|
---|
109 |
|
---|
110 | <p>Creates or replaces the file MANIFEST.MF. Note that the Built-By
|
---|
111 | attribute will take the value of the Ant property ${user.name}. The
|
---|
112 | same is true for the ${version} and ${TODAY} properties. This example
|
---|
113 | produces a MANIFEST.MF that contains
|
---|
114 | <a href="http://java.sun.com/products/jdk/1.2/docs/guide/versioning/index.html">package
|
---|
115 | version 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
|
---|
120 | Built-By: bodewig
|
---|
121 | Created-By: Apache Ant 1.5alpha
|
---|
122 |
|
---|
123 | Name: common
|
---|
124 | Specification-Title: Example
|
---|
125 | Specification-Vendor: Example Organization
|
---|
126 | Implementation-Vendor: Example Corp.
|
---|
127 | Specification-Version: 1.1
|
---|
128 | Implementation-Version: 1.1 February 19 2002
|
---|
129 | Implementation-Title: common
|
---|
130 |
|
---|
131 | Name: common/class1.class
|
---|
132 | Sealed: false
|
---|
133 |
|
---|
134 | </code></pre>
|
---|
135 |
|
---|
136 | <hr>
|
---|
137 | <p align="center">Copyright © 2001-2004 The Apache Software Foundation. All rights
|
---|
138 | Reserved.</p>
|
---|
139 | </body>
|
---|
140 | </html>
|
---|
141 |
|
---|