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 4.6 KiB

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