|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?xml version="1.0"?>
-
- <project name="manifestclasspath" default="tearDown">
-
- <target name="setUp">
- <property name="tmp" location="${basedir}/${ant.project.name}.tmp" />
- <mkdir dir="${tmp}" />
- </target>
-
- <target name="fullSetUp" depends="setUp">
- <mkdir dir="${tmp}/lib" />
- <touch file="${tmp}/lib/acme-core.jar" />
- <touch file="${tmp}/lib/acme-pres.jar" />
-
- <mkdir dir="${tmp}/classes/dsp-core/com/lgc/infra/core" />
- <mkdir dir="${tmp}/classes/dsp-pres/com/lgc/infra/pres" />
- <mkdir dir="${tmp}/classes/dsp-void" />
- <mkdir dir="${tmp}/generated/dsp-core/com/lgc/infra/core/generated" />
- <mkdir dir="${tmp}/generated/dsp-pres" />
- <mkdir dir="${tmp}/generated/dsp-void" />
- <mkdir dir="${tmp}/resources/dsp-core/com/lgc/infra/core" />
- <mkdir dir="${tmp}/resources/dsp-pres/com/lgc/infra/pres" />
- <mkdir dir="${tmp}/resources/dsp-void" />
- </target>
-
- <target name="tearDown">
- <delete dir="${tmp}" />
- </target>
-
- <target name="test-bad-directory">
- <manifestclasspath property="jar.classpath"
- jarfile="${tmp}/classpath.jar">
- <classpath />
- </manifestclasspath>
- </target>
-
- <target name="test-bad-no-property" depends="setUp">
- <manifestclasspath jarfile="${tmp}/classpath.jar">
- <classpath />
- </manifestclasspath>
- </target>
-
- <target name="test-bad-property-exists" depends="setUp">
- <property name="jar.classpath" value="exists" />
- <manifestclasspath property="jar.classpath"
- jarfile="${tmp}/classpath.jar">
- <classpath />
- </manifestclasspath>
- </target>
-
- <target name="test-bad-no-jarfile" depends="setUp">
- <manifestclasspath property="jar.classpath">
- <classpath />
- </manifestclasspath>
- </target>
-
- <target name="test-bad-no-classpath" depends="setUp">
- <manifestclasspath property="jar.classpath"
- jarfile="${tmp}/classpath.jar" />
- </target>
-
- <target name="test-pseudo-tahoe-refid" depends="fullSetUp">
- <path id="classpath">
- <!-- All the classes/ directories -->
- <dirset dir="${tmp}/classes" includes="dsp-*" />
-
- <!-- All the JAXB generated/ directories -->
- <dirset dir="${tmp}/generated" includes="dsp-*">
- <!-- Add only non-empty directories to the classpath -->
- <present targetdir="${tmp}/generated" present="both">
- <mapper type="regexp" from="(.*)" to="\1/com" />
- </present>
- </dirset>
-
- <!-- All the resources/ directories -->
- <dirset dir="${tmp}/resources" includes="dsp-*">
- <!-- Add only non-empty directories to the classpath -->
- <present targetdir="${tmp}/resources" present="both">
- <mapper type="regexp" from="(.*)" to="\1/com" />
- </present>
- </dirset>
- </path>
-
- <manifestclasspath property="jar.classpath"
- jarfile="${tmp}/classpath.jar">
- <classpath refid="classpath" />
- </manifestclasspath>
- </target>
-
- <target name="test-pseudo-tahoe-nested" depends="fullSetUp">
- <manifestclasspath property="jar.classpath"
- jarfile="${tmp}/classpath.jar">
- <classpath>
- <!-- All the classes/ directories -->
- <dirset dir="${tmp}/classes" includes="dsp-*" />
-
- <!-- All the JAXB generated/ directories -->
- <dirset dir="${tmp}/generated" includes="dsp-*">
- <!-- Add only non-empty directories to the classpath -->
- <present targetdir="${tmp}/generated" present="both">
- <mapper type="regexp" from="(.*)" to="\1/com" />
- </present>
- </dirset>
-
- <!-- All the resources/ directories -->
- <dirset dir="${tmp}/resources" includes="dsp-*">
- <!-- Add only non-empty directories to the classpath -->
- <present targetdir="${tmp}/resources" present="both">
- <mapper type="regexp" from="(.*)" to="\1/com" />
- </present>
- </dirset>
- </classpath>
- </manifestclasspath>
- </target>
-
- <target name="test-parent-level1" depends="fullSetUp">
- <manifestclasspath property="jar.classpath"
- jarfile="${tmp}/classes/classpath.jar">
- <classpath>
- <dirset dir="${tmp}/classes" includes="dsp-*" />
- <dirset dir="${tmp}/generated" includes="dsp-*" />
- <dirset dir="${tmp}/resources" includes="dsp-*" />
- </classpath>
- </manifestclasspath>
- </target>
-
- <target name="test-parent-level2" depends="fullSetUp">
- <mkdir dir="${tmp}/classes/level2" />
- <manifestclasspath property="jar.classpath"
- jarfile="${tmp}/classes/level2/classpath.jar">
- <classpath>
- <dirset dir="${tmp}/classes" includes="dsp-*" />
- <dirset dir="${tmp}/generated" includes="dsp-*" />
- <dirset dir="${tmp}/resources" includes="dsp-*" />
- </classpath>
- </manifestclasspath>
- </target>
-
- <target name="test-parent-level2-too-deep" depends="fullSetUp">
- <mkdir dir="${tmp}/classes/level2" />
- <manifestclasspath property="jar.classpath" maxParentLevels="1"
- jarfile="${tmp}/classes/level2/classpath.jar">
- <classpath>
- <dirset dir="${tmp}/classes" includes="dsp-*" />
- <dirset dir="${tmp}/generated" includes="dsp-*" />
- <dirset dir="${tmp}/resources" includes="dsp-*" />
- </classpath>
- </manifestclasspath>
- </target>
-
- <target name="test-parent-level2-with-jars" depends="fullSetUp">
- <mkdir dir="${tmp}/classes/level2" />
- <manifestclasspath property="jar.classpath"
- jarfile="${tmp}/classes/level2/classpath.jar">
- <classpath>
- <fileset dir="${tmp}/lib" includes="*.jar" />
- <dirset dir="${tmp}/classes" includes="dsp-*" />
- <dirset dir="${tmp}/generated" includes="dsp-*" />
- <dirset dir="${tmp}/resources" includes="dsp-*" />
- </classpath>
- </manifestclasspath>
- </target>
-
- </project>
|