You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

manifest.html 5.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Manifest Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="manifest">Manifest</a></h2>
  8. <h3>Description</h3>
  9. <p>Creates a manifest file.</p>
  10. <p>This task can be used to write a Manifest file, optionally
  11. replacing or updating an existing file.</p>
  12. <p>
  13. The Ant team regularly gets complaints that this task in generating invalid
  14. manifests. By and large, this is not the case: we believe that we are following
  15. the specification to the letter. The usual problem is that some third party
  16. manifest reader is not following the same specification as well as they think
  17. they should; we cannot generate invalid manifest files just because one
  18. single application is broken.
  19. </p>
  20. <p>Manifests are processed according to the
  21. <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html">Jar
  22. file specification.</a>. Specifically, a manifest element consists of
  23. a set of attributes and sections. These sections in turn may contain
  24. attributes. Note in particular that this may result in manifest lines
  25. greater than 72 bytes being wrapped and continued on the next
  26. line.</p>
  27. <h3>Parameters</h3>
  28. <table border="1" cellpadding="2" cellspacing="0">
  29. <tr>
  30. <td valign="top"><b>Attribute</b></td>
  31. <td valign="top"><b>Description</b></td>
  32. <td align="center" valign="top"><b>Required</b></td>
  33. </tr>
  34. <tr>
  35. <td valign="top">file</td>
  36. <td valign="top">the manifest-file to create/update.</td>
  37. <td valign="top" align="center">Yes</td>
  38. </tr>
  39. <tr>
  40. <td valign="top">mode</td>
  41. <td valign="top">One of "update" or "replace", default is "replace".</td>
  42. <td valign="top" align="center">No</td>
  43. </tr>
  44. <tr>
  45. <td valign="top">encoding</td>
  46. <td valign="top">The encoding used to read the existing manifest when updating.</td>
  47. <td valign="top" align="center">No, defaults to UTF-8 encoding.</td>
  48. </tr>
  49. </table>
  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. <h4>section</h4>
  72. <p>A manifest section - you can nest <a
  73. href="#attribute">attribute</a> elements into sections.</p>
  74. <table border="1" cellpadding="2" cellspacing="0">
  75. <tr>
  76. <td valign="top"><b>Attribute</b></td>
  77. <td valign="top"><b>Description</b></td>
  78. <td align="center" valign="top"><b>Required</b></td>
  79. </tr>
  80. <tr>
  81. <td valign="top">name</td>
  82. <td valign="top">the name of the section.</td>
  83. <td valign="top" align="center">No, if omitted it will be assumed
  84. to be the main section.</td>
  85. </tr>
  86. </table>
  87. <h3>Examples</h3>
  88. <pre>
  89. &lt;manifest file=&quot;MANIFEST.MF&quot;&gt;
  90. &lt;attribute name=&quot;Built-By&quot; value=&quot;${user.name}&quot;/&gt;
  91. &lt;section name=&quot;common&quot;&gt;
  92. &lt;attribute name=&quot;Specification-Title&quot; value=&quot;Example&quot;/&gt;
  93. &lt;attribute name=&quot;Specification-Version&quot; value=&quot;${version}&quot;/&gt;
  94. &lt;attribute name=&quot;Specification-Vendor&quot; value=&quot;Example Organization&quot;/&gt;
  95. &lt;attribute name=&quot;Implementation-Title&quot; value=&quot;common&quot;/&gt;
  96. &lt;attribute name=&quot;Implementation-Version&quot; value=&quot;${version} ${TODAY}&quot;/&gt;
  97. &lt;attribute name=&quot;Implementation-Vendor&quot; value=&quot;Example Corp.&quot;/&gt;
  98. &lt;/section&gt;
  99. &lt;section name=&quot;common/class1.class&quot;&gt;
  100. &lt;attribute name=&quot;Sealed&quot; value=&quot;false&quot;/&gt;
  101. &lt;/section&gt;
  102. &lt;/manifest&gt;
  103. </pre>
  104. <p>Creates or replaces the file MANIFEST.MF. Note that the Built-By
  105. attribute will take the value of the Ant property ${user.name}. The
  106. same is true for the ${version} and ${TODAY} properties. This example
  107. produces a MANIFEST.MF that contains
  108. <a href="http://java.sun.com/products/jdk/1.2/docs/guide/versioning/index.html">package
  109. version identification</a> for the package <code>common</code>.</p>
  110. <p>The manifest produced by the above would look like this:</p>
  111. <pre><code>Manifest-Version: 1.0
  112. Built-By: bodewig
  113. Created-By: Apache Ant 1.5alpha
  114. Name: common
  115. Specification-Title: Example
  116. Specification-Vendor: Example Organization
  117. Implementation-Vendor: Example Corp.
  118. Specification-Version: 1.1
  119. Implementation-Version: 1.1 February 19 2002
  120. Implementation-Title: common
  121. Name: common/class1.class
  122. Sealed: false
  123. </code></pre>
  124. <hr>
  125. <p align="center">Copyright &copy; 2001-2004 The Apache Software Foundation. All rights
  126. Reserved.</p>
  127. </body>
  128. </html>