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.

manifestclasspath.xml 6.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?xml version="1.0"?>
  2. <project name="manifestclasspath" default="tearDown">
  3. <target name="setUp">
  4. <property name="tmp" location="${basedir}/${ant.project.name}.tmp" />
  5. <mkdir dir="${tmp}" />
  6. </target>
  7. <target name="fullSetUp" depends="setUp">
  8. <mkdir dir="${tmp}/lib" />
  9. <touch file="${tmp}/lib/acme-core.jar" />
  10. <touch file="${tmp}/lib/acme-pres.jar" />
  11. <mkdir dir="${tmp}/classes/dsp-core/com/lgc/infra/core" />
  12. <mkdir dir="${tmp}/classes/dsp-pres/com/lgc/infra/pres" />
  13. <mkdir dir="${tmp}/classes/dsp-void" />
  14. <mkdir dir="${tmp}/generated/dsp-core/com/lgc/infra/core/generated" />
  15. <mkdir dir="${tmp}/generated/dsp-pres" />
  16. <mkdir dir="${tmp}/generated/dsp-void" />
  17. <mkdir dir="${tmp}/resources/dsp-core/com/lgc/infra/core" />
  18. <mkdir dir="${tmp}/resources/dsp-pres/com/lgc/infra/pres" />
  19. <mkdir dir="${tmp}/resources/dsp-void" />
  20. </target>
  21. <target name="tearDown">
  22. <delete dir="${tmp}" />
  23. </target>
  24. <target name="test-bad-directory">
  25. <manifestclasspath property="jar.classpath"
  26. jarfile="${tmp}/classpath.jar">
  27. <classpath />
  28. </manifestclasspath>
  29. </target>
  30. <target name="test-bad-no-property" depends="setUp">
  31. <manifestclasspath jarfile="${tmp}/classpath.jar">
  32. <classpath />
  33. </manifestclasspath>
  34. </target>
  35. <target name="test-bad-property-exists" depends="setUp">
  36. <property name="jar.classpath" value="exists" />
  37. <manifestclasspath property="jar.classpath"
  38. jarfile="${tmp}/classpath.jar">
  39. <classpath />
  40. </manifestclasspath>
  41. </target>
  42. <target name="test-bad-no-jarfile" depends="setUp">
  43. <manifestclasspath property="jar.classpath">
  44. <classpath />
  45. </manifestclasspath>
  46. </target>
  47. <target name="test-bad-no-classpath" depends="setUp">
  48. <manifestclasspath property="jar.classpath"
  49. jarfile="${tmp}/classpath.jar" />
  50. </target>
  51. <target name="test-pseudo-tahoe-refid" depends="fullSetUp">
  52. <path id="classpath">
  53. <!-- All the classes/ directories -->
  54. <dirset dir="${tmp}/classes" includes="dsp-*" />
  55. <!-- All the JAXB generated/ directories -->
  56. <dirset dir="${tmp}/generated" includes="dsp-*">
  57. <!-- Add only non-empty directories to the classpath -->
  58. <present targetdir="${tmp}/generated" present="both">
  59. <mapper type="regexp" from="(.*)" to="\1/com" />
  60. </present>
  61. </dirset>
  62. <!-- All the resources/ directories -->
  63. <dirset dir="${tmp}/resources" includes="dsp-*">
  64. <!-- Add only non-empty directories to the classpath -->
  65. <present targetdir="${tmp}/resources" present="both">
  66. <mapper type="regexp" from="(.*)" to="\1/com" />
  67. </present>
  68. </dirset>
  69. </path>
  70. <manifestclasspath property="jar.classpath"
  71. jarfile="${tmp}/classpath.jar">
  72. <classpath refid="classpath" />
  73. </manifestclasspath>
  74. </target>
  75. <target name="test-pseudo-tahoe-nested" depends="fullSetUp">
  76. <manifestclasspath property="jar.classpath"
  77. jarfile="${tmp}/classpath.jar">
  78. <classpath>
  79. <!-- All the classes/ directories -->
  80. <dirset dir="${tmp}/classes" includes="dsp-*" />
  81. <!-- All the JAXB generated/ directories -->
  82. <dirset dir="${tmp}/generated" includes="dsp-*">
  83. <!-- Add only non-empty directories to the classpath -->
  84. <present targetdir="${tmp}/generated" present="both">
  85. <mapper type="regexp" from="(.*)" to="\1/com" />
  86. </present>
  87. </dirset>
  88. <!-- All the resources/ directories -->
  89. <dirset dir="${tmp}/resources" includes="dsp-*">
  90. <!-- Add only non-empty directories to the classpath -->
  91. <present targetdir="${tmp}/resources" present="both">
  92. <mapper type="regexp" from="(.*)" to="\1/com" />
  93. </present>
  94. </dirset>
  95. </classpath>
  96. </manifestclasspath>
  97. </target>
  98. <target name="test-parent-level1" depends="fullSetUp">
  99. <manifestclasspath property="jar.classpath"
  100. jarfile="${tmp}/classes/classpath.jar">
  101. <classpath>
  102. <dirset dir="${tmp}/classes" includes="dsp-*" />
  103. <dirset dir="${tmp}/generated" includes="dsp-*" />
  104. <dirset dir="${tmp}/resources" includes="dsp-*" />
  105. </classpath>
  106. </manifestclasspath>
  107. </target>
  108. <target name="test-parent-level2" depends="fullSetUp">
  109. <mkdir dir="${tmp}/classes/level2" />
  110. <manifestclasspath property="jar.classpath"
  111. jarfile="${tmp}/classes/level2/classpath.jar">
  112. <classpath>
  113. <dirset dir="${tmp}/classes" includes="dsp-*" />
  114. <dirset dir="${tmp}/generated" includes="dsp-*" />
  115. <dirset dir="${tmp}/resources" includes="dsp-*" />
  116. </classpath>
  117. </manifestclasspath>
  118. </target>
  119. <target name="test-parent-level2-too-deep" depends="fullSetUp">
  120. <mkdir dir="${tmp}/classes/level2" />
  121. <manifestclasspath property="jar.classpath" maxParentLevels="1"
  122. jarfile="${tmp}/classes/level2/classpath.jar">
  123. <classpath>
  124. <dirset dir="${tmp}/classes" includes="dsp-*" />
  125. <dirset dir="${tmp}/generated" includes="dsp-*" />
  126. <dirset dir="${tmp}/resources" includes="dsp-*" />
  127. </classpath>
  128. </manifestclasspath>
  129. </target>
  130. <target name="test-parent-level2-with-jars" depends="fullSetUp">
  131. <mkdir dir="${tmp}/classes/level2" />
  132. <manifestclasspath property="jar.classpath"
  133. jarfile="${tmp}/classes/level2/classpath.jar">
  134. <classpath>
  135. <fileset dir="${tmp}/lib" includes="*.jar" />
  136. <dirset dir="${tmp}/classes" includes="dsp-*" />
  137. <dirset dir="${tmp}/generated" includes="dsp-*" />
  138. <dirset dir="${tmp}/resources" includes="dsp-*" />
  139. </classpath>
  140. </manifestclasspath>
  141. </target>
  142. </project>