<?xml version="1.0"?> <project name="portal" default="junit" basedir="."> <property name="source.dir" value="src" /> <property name="build.dir" value="build" /> <property name="lib.dir" value="lib" /> <property name="classes.dir" value="${build.dir}/classes" /> <property name="report.dir" value="report" /> <!-- ================================================================== --> <!-- C L E A N --> <!-- ================================================================== --> <target name="clean"> <delete dir="${classes.dir}" /> <mkdir dir="${classes.dir}" /> <delete dir="${report.dir}" /> <mkdir dir="${report.dir}" /> </target> <!-- ================================================================== --> <!-- C O M P I L E --> <!-- ================================================================== --> <target name="compile" depends="clean"> <!-- local project jars --> <patternset id="lib.includes.compile"> <include name="*.jar" /> </patternset> <fileset dir="${lib.dir}" id="lib.compile"> <patternset refid="lib.includes.compile" /> </fileset> <pathconvert targetos="windows" property="libs.compile" refid="lib.compile" /> <!-- compile --> <javac srcdir="${source.dir}" destdir="${classes.dir}" classpath="${libs.compile}" includes="**/*.java" debug="true"> </javac> </target> <!-- ================================================================== --> <!-- J U N I T --> <!-- ================================================================== --> <target name="junit" depends="compile"> <junit printsummary="on" fork="true" haltonfailure="false" failureproperty="tests.failed" showoutput="true"> <classpath> <pathelement path="${classes.dir}" /> <fileset dir="${lib.dir}"> <include name="**/*.jar" /> </fileset> </classpath> <formatter type="xml" /> <batchtest todir="${report.dir}"> <fileset dir="${classes.dir}"> <include name="**/*Test.*" /> </fileset> </batchtest> </junit> <junitreport todir="${report.dir}"> <fileset dir="${report.dir}"> <include name="TEST-*.xml" /> </fileset> <report format="frames" todir="${report.dir}" /> </junitreport> <fail if="tests.failed"> </fail> </target> </project> |