<?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>