Well basically, I downloaded a shopping cart from the Internet and trying to make it work after downloading the necessary software.
The build.xml in the Framework\Lab directory (shoppinf cart)uses an external entity to basically import buildCommon.xml that is in the top directory. That file defines where many libraries like Xerces and Xalan should be found. I unzipped Xerces and Xalan to different directories then I either have to move them or modify buildCommon.xml to point to them.
I modified
alot of buildCommom.xml to match my files. But there are few sections which I left them as they are maybe you could help me out.
The code below is quiet big. I couldn't reduce it less than that because I thought I would give you a clear picture of what buildCommon.xml includes. I've removed bits which I think are not related to Ant-Junit.
There are bits which are
bold either need to be changed but don't know how or don't what they represent(in other words are they important to be there).
Thank you.
<property name="junitRoot" value="C:"/>
<property name="antDir" value="${antRoot}/apache-ant-1.6.0"/>
<property name="junitDir" value="${junitRoot}/apache-ant-1.6.0"/>
<property name="ant" value="${antDir}/lib/ant.jar"/>
<property name="buildDir" value="classes"/>
<property name="docDir" value="doc"/> <property name="docRoot" value="docroot"/> <property name="javadocDir" value="${docDir}/api"/> <property name="junit" value="${junitDir}/lib/ant-junit.jar"/>
<property name="libDir" value="lib"/>[/B]
<property name="srcDir" value="src"/>[/B]
<property name="util" value="Util/classes"/> <target name="cleanTestLogs" description="deletes generated JUnit log files">
<delete>
<fileset dir=".">
<include name="TEST-*.txt"/> <!-- generated by the
test target -->
</fileset>
</delete>
</target>
<target name="compile" depends="prepare" description="compiles source files">
<javac srcdir="${srcDir}" destdir="${buildDir}"
classpathref="classpath" deprecation="on"/> </target>
<target name="compileUtil" unless="utilCompiled"
description="compiles Util source files">
<ant dir="../../Util" target="compile"/> </target>
<target name="init" description="performs initialization steps">
<parallel>
<available property="haveJUnit"
classpath="${junit}" classname="junit.framework.TestCase"/> </parallel>
</target>
<target name="javadoc" depends="compile"
description="generates javadoc from all .java files">
<delete dir="${javadocDir}"/>
<mkdir dir="${javadocDir}"/>
<javadoc sourcepath="${srcDir}" destdir="${javadocDir}"
packagenames="com.*" classpathref="classpath"/>
</target>
<target name="prepare"
depends="init,verifyant-junit,verifyMySQL,verifyTomcat,verifyXalan,verifyXerces"
description="create output directories">
<parallel>
<mkdir dir="${buildDir}"/>
<mkdir dir="${docDir}"/>
<mkdir dir="${libDir}"/>
<available property="utilCompiled" file="Util/classes"/>
</parallel>
</target>
<target name="run" depends="compile" description="runs main class">
<
java classname="${mainClass}" classpathref="classpath" fork="yes"/>
</target>
<target name="test" depends="compile,cleanTestLogs"
description="runs all ant-junit tests">
<ant-junit fork="yes" printsummary="yes">
<classpath refid="classpath"/>
<batchtest>
<fileset dir="${srcDir}">
<include name="**/*Test.java"/>
</fileset>
<formatter type="plain"/>
</batchtest>
</ant-junit>
</target>
<target name="verifyant-junit" unless="haveant-junit">
<fail message="ANT-JUnit not found in Ant's CLASSPATH!"/>
</target>
<target name="zip" description="zips files in this directory">
<zip zipfile="${zipFile}" basedir="."
excludes="${zipFile},${buildDir}/**,${javadocDir}/**"/>
</target>