<?xml version="1.0" encoding="UTF-8" ?>
<project name="busimonitor" basedir=".">
<property name="src.java.dir" location="${basedir}/app" />
<property name="src.test.dir" location="${basedir}/test" />
<property name="target.dir" location="${basedir}/classes" />
<property name="target.java.dir" location="${target.dir}/java" />
<property name="target.unit-test.dir" location="${target.dir}/unit-test" />
<property name="target.cover-test.dir" location="${target.dir}/cover-test" />
<property name="src.extend.lib.dir" location="${basedir}/lib"/>
<property name="play.lib.dir" location="/devdata/projects/game/play-1.2.5/framework" />
<property name="target.report.dir" location="${basedir}/report" />
<property name="target.unit-test-report.dir" location="${target.report.dir}/unit-test" />
<property name="target.cover-test-report.dir" location="${target.report.dir}/cover-test" />
<path id="app.classpath">
<fileset dir="${play.lib.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${src.extend.lib.dir}">
<include name="*.jar" />
</fileset>
<path location="${target.java.dir}" />
<path location="${basedir}/conf" />
</path>
<path id="app.test.classpath">
<path location="${target.unit-test.dir}" />
</path>
<target name="compile.java">
<mkdir dir="${target.java.dir}" />
<javac srcdir="${src.java.dir}" destdir="${target.java.dir}"
debug="on" source="1.6" includeantruntime="on">
<classpath refid="app.classpath"></classpath>
</javac>
</target>
<target name="compile.test" depends="compile.java">
<mkdir dir="${target.unit-test.dir}" />
<javac srcdir="${src.test.dir}" destdir="${target.unit-test.dir}"
debug="on" source="1.6" includeantruntime="on">
<classpath refid="app.classpath"></classpath>
<classpath refid="app.test.classpath"></classpath>
</javac>
<copy todir="${target.unit-test.dir}">
<fileset dir="${src.test.dir}">
<include name="**/*.properties" />
<include name="**/*.xml" />
</fileset>
</copy>
</target>
<target name="compile" depends="compile.java, compile.test"></target>
<target name="unit-test" depends="compile">
<mkdir dir="${target.unit-test-report.dir}" />
<junit printsummary="on" haltonerror="off"
haltonfailure="off" fork="on">
<formatter type="plain" usefile="off"/>
<formatter type="xml" usefile="on" />
<batchtest todir="${target.unit-test-report.dir}">
<fileset dir="${target.unit-test.dir}">
<include name="**/*Test.class"/>
</fileset>
</batchtest>
<classpath refid="app.classpath"></classpath>
<classpath refid="app.test.classpath"></classpath>
</junit>
</target>
<target name="unit-test-report" depends="unit-test">
<mkdir dir="${target.unit-test-report.dir}/html" />
<junitreport todir="${target.unit-test-report.dir}">
<fileset dir="${target.unit-test-report.dir}">
<include name="TEST-*.xml" />
</fileset>
<report todir="${target.unit-test-report.dir}/html" />
</junitreport>
</target>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<target name="cover-instrument" depends="compile">
<mkdir dir="${target.cover-test.dir}"/>
<cobertura-instrument todir="${target.cover-test.dir}">
<fileset dir="${target.java.dir}">
<include name="**/**.class" />
</fileset>
</cobertura-instrument>
</target>
<target name="cover-test" depends="cover-instrument">
<mkdir dir="${target.cover-test-report.dir}"/>
<junit printsummary="on" haltonerror="on" haltonfailure="on" fork="on">
<classpath path="${target.cover-test.dir}" />
<classpath refid="app.test.classpath" />
<classpath refid="app.classpath" />
<batchtest todir="${target.cover-test-report.dir}">
<fileset dir="${target.unit-test.dir}">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="cover-report" depends="cover-test">
<cobertura-report srcdir="${src.java.dir}" destdir="${target.cover-test-report.dir}" />
</target>
</project>