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.xml 8.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <?xml version="1.0"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- Manifest tests build file -->
  17. <project name="manifest-test" basedir="." default="test1">
  18. <import file="../buildfiletest-base.xml"/>
  19. <target name="setUp">
  20. <mkdir dir="${output}/manifests"/>
  21. </target>
  22. <target name="test1" depends="setUp">
  23. <jar file="${output}/mftest1.jar" manifest="manifests/test1.mf"/>
  24. <unjar src="${output}/mftest1.jar" dest="${output}/manifests">
  25. <patternset>
  26. <include name="META-INF/MANIFEST.MF"/>
  27. </patternset>
  28. </unjar>
  29. </target>
  30. <target name="test2" depends="setUp">
  31. <jar file="${output}/mftest2.jar" manifest="manifests/test2.mf"/>
  32. <unjar src="${output}/mftest2.jar" dest="${output}/manifests">
  33. <patternset>
  34. <include name="META-INF/MANIFEST.MF"/>
  35. </patternset>
  36. </unjar>
  37. </target>
  38. <target name="test3" depends="setUp">
  39. <jar file="${output}/mftest3.jar" manifest="manifests/test3.mf"/>
  40. </target>
  41. <target name="test4" depends="setUp">
  42. <jar file="${output}/mftest4.jar" manifest="manifests/test4.mf"/>
  43. </target>
  44. <target name="test5" depends="setUp">
  45. <jar file="${output}/mftest5.jar" manifest="manifests/test5.mf"/>
  46. </target>
  47. <target name="test6" depends="setUp">
  48. <jar file="${output}/mftest6.jar" manifest="manifests/test6.mf"/>
  49. </target>
  50. <target name="test7" depends="setUp">
  51. <jar file="${output}/mftest7.jar" manifest="manifests/test7.mf"/>
  52. </target>
  53. <target name="test8" depends="setUp">
  54. <jar file="${output}/mftest8.jar">
  55. <manifest>
  56. <attribute name="Class-Path" value="fubar"/>
  57. <section name="Test">
  58. <attribute name="TestAttr" value="Test"/>
  59. </section>
  60. </manifest>
  61. </jar>
  62. <unjar src="${output}/mftest8.jar" dest="${output}/manifests">
  63. <patternset>
  64. <include name="META-INF/MANIFEST.MF"/>
  65. </patternset>
  66. </unjar>
  67. </target>
  68. <target name="test9" depends="setUp">
  69. <jar file="${output}/mftest9.jar">
  70. <manifest>
  71. <attribute name="Class-Path" value="fubar"/>
  72. <section name="Test">
  73. <attribute name="Name" value="Test"/>
  74. </section>
  75. </manifest>
  76. </jar>
  77. </target>
  78. <target name="test10" depends="setUp">
  79. <jar file="${output}/mftest10.jar">
  80. <manifest>
  81. <attribute value="fubar"/>
  82. </manifest>
  83. </jar>
  84. </target>
  85. <target name="test11" depends="setUp">
  86. <jar file="${output}/mftest11.jar">
  87. <manifest>
  88. <attribute name="Test"/>
  89. </manifest>
  90. </jar>
  91. </target>
  92. <target name="test12" depends="setUp">
  93. <jar file="${output}/mftest12.jar">
  94. <manifest>
  95. <section>
  96. <attribute name="TestAttr" value="Test"/>
  97. </section>
  98. </manifest>
  99. </jar>
  100. </target>
  101. <target name="test13" depends="setUp">
  102. <jar file="${output}/mftest13.jar">
  103. <manifest>
  104. <attribute name="Test" value="Test1"/>
  105. <attribute name="Test" value="Test2"/>
  106. </manifest>
  107. </jar>
  108. </target>
  109. <target name="test14" depends="setUp">
  110. <jar file="${output}/mftest14.jar">
  111. <manifest>
  112. <attribute name="Class-path" value="Test1"/>
  113. <attribute name="Class-path" value="Test2"/>
  114. <attribute name="Class-Path" value="Test3"/>
  115. <attribute name="class-Path" value="Test4"/>
  116. </manifest>
  117. </jar>
  118. <unjar src="${output}/mftest14.jar" dest="${output}/manifests">
  119. <patternset>
  120. <include name="META-INF/MANIFEST.MF"/>
  121. </patternset>
  122. </unjar>
  123. </target>
  124. <target name="testNoFile">
  125. <manifest/>
  126. </target>
  127. <target name="testLongLine" depends="setUp">
  128. <jar file="${output}/mftestLongLine.jar">
  129. <manifest>
  130. <attribute name="Class-path"
  131. value="${test.longline}"/>
  132. <attribute name="${test.long68name}" value="${test.value}"/>
  133. <attribute name="${test.long70name}" value="${test.value}"/>
  134. <attribute name="${test.notlongname}" value="${test.value}"/>
  135. </manifest>
  136. </jar>
  137. <unjar src="${output}/mftestLongLine.jar" dest="${output}/manifests">
  138. <patternset>
  139. <include name="META-INF/MANIFEST.MF"/>
  140. </patternset>
  141. </unjar>
  142. </target>
  143. <target name="testOrder1" depends="setUp">
  144. <jar file="${output}/mftestOrder1.jar">
  145. <manifest>
  146. <section name="Test1">
  147. <attribute name="TestAttr1" value="Test1"/>
  148. <attribute name="TestAttr2" value="Test2"/>
  149. </section>
  150. <section name="Test2">
  151. <attribute name="TestAttrx" value="Testx"/>
  152. </section>
  153. </manifest>
  154. </jar>
  155. <unjar src="${output}/mftestOrder1.jar" dest="${output}/manifests">
  156. <patternset>
  157. <include name="META-INF/MANIFEST.MF"/>
  158. </patternset>
  159. </unjar>
  160. </target>
  161. <target name="testOrder2" depends="setUp">
  162. <jar file="${output}/mftestOrder2.jar">
  163. <manifest>
  164. <section name="Test2">
  165. <attribute name="TestAttrx" value="Testx"/>
  166. </section>
  167. <section name="Test1">
  168. <attribute name="TestAttr2" value="Test2"/>
  169. <attribute name="TestAttr1" value="Test1"/>
  170. </section>
  171. </manifest>
  172. </jar>
  173. <unjar src="${output}/mftestOrder2.jar" dest="${output}/manifests">
  174. <patternset>
  175. <include name="META-INF/MANIFEST.MF"/>
  176. </patternset>
  177. </unjar>
  178. </target>
  179. <target name="testReplace" depends="setUp">
  180. <copy file="manifests/test2.mf" toFile="${output}/mftest.mf"/>
  181. <manifest file="${output}/mftest.mf"/>
  182. </target>
  183. <target name="testUpdate" depends="setUp">
  184. <copy file="manifests/test2.mf" toFile="${output}/mftest.mf"/>
  185. <manifest file="${output}/mftest.mf" mode="update">
  186. <attribute name="Foo" value="Bar"/>
  187. </manifest>
  188. <copy file="manifests/test2.mf" toFile="${output}/mftest2.mf"/>
  189. <manifest file="${output}/mftest2.mf" mode="update">
  190. <section name="Test">
  191. <attribute name="Foo" value="Bar"/>
  192. </section>
  193. </manifest>
  194. <manifest file="${output}/mftest2.mf" mode="update">
  195. <section name="Test">
  196. <attribute name="Foo" value="Baz"/>
  197. </section>
  198. </manifest>
  199. </target>
  200. <target name="testFrom" depends="setUp">
  201. <manifest file="${output}/mftestfrom.mf">
  202. <section name="Test">
  203. <attribute name="before" value="before"/>
  204. <attribute name="From" value="illegal"/>
  205. <attribute name="after" value="after"/>
  206. </section>
  207. </manifest>
  208. </target>
  209. <target name="testIllegalName" depends="setUp">
  210. <manifest file="${output}/mftestillegalname.mf">
  211. <attribute name="has blank" value="value"/>
  212. </manifest>
  213. </target>
  214. <target name="testIllegalNameInSection" depends="setUp">
  215. <manifest file="${output}/mftestillegalnameinsection.mf">
  216. <section name="s1">
  217. <attribute name="has blank" value="value"/>
  218. </section>
  219. </manifest>
  220. </target>
  221. <target name="testIllegalNameBegin" depends="setUp">
  222. <manifest file="${output}/mftestillegalnamebegin.mf">
  223. <attribute name="-name" value="value"/>
  224. </manifest>
  225. </target>
  226. <target name="testIllegalName2" depends="setUp">
  227. <manifest file="${output}/mftestillegalnamebegin.mf">
  228. <attribute name="has.point" value="value"/>
  229. </manifest>
  230. </target>
  231. <target name="testIllegalName3" depends="setUp">
  232. <manifest file="${output}/mftestillegalnamebegin.mf">
  233. <attribute name="has*star" value="value"/>
  234. </manifest>
  235. </target>
  236. </project>