<?xml version="1.0" encoding="UTF-8"?>
<!-- WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
              To include a user specific buildfile here, simply create one in the same
              directory with the processing instruction <?eclipse.ant.import?>
              as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="SimpleMath">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="../../../../../Applications/eclipse"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.5"/>
    <property name="source" value="1.5"/>
    <property name="classes" value="./bin"/>
    <path id="JUnit 3.libraryclasspath">
        <pathelement location="${ECLIPSE_HOME}/plugins/org.junit_3.8.2.v20080602-1318/junit.jar"/>
    </path>
    <path id="SimpleMath.classpath">
        <pathelement location="bin"/>
        <path refid="JUnit 3.libraryclasspath"/>
        <pathelement location="../../../../../Applications/eclipse/plugins/com.codign.coview_3.1.0/codignjunit.jar"/>
        <pathelement location="../../../../../Applications/eclipse/plugins/com.codign.coview_3.1.0/jmockit.jar"/>
        <pathelement location="../../../../../Applications/eclipse/plugins/com.codign.coview_3.1.0/hamcrest-core-1.1.jar"/>
        <pathelement location="../../../../../Applications/eclipse/plugins/com.codign.coview_3.1.0/hamcrest-library-1.1.jar"/>
    </path>

	<path id="test.classpath">
		<pathelement location="bin"/>
		<pathelement location="/Applications/eclipse/plugins/org.junit_3.8.2.v20080602-1318/junit.jar"/>
        <!-- Referencing comet classpath in the runtime classpath for unit tests: -->
		<path refid="cometclasspathid"/>
	</path>
	<path id="cometclasspathid">
		<pathelement location="/Users/jponczak/Documents/build3.1.0/comet/comet.jar"/>
	</path>

    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src">
                <exclude name="**/*.launch"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
            <src path="src"/>
            <classpath refid="SimpleMath.classpath"/>
        </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
        <copy todir="${ant.library.dir}">
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </copy>
        <unzip dest="${ant.library.dir}">
            <patternset includes="jdtCompilerAdapter.jar"/>
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
        <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
        <antcall target="build"/>
    </target>
    <target name="test">
	<junit fork="yes" haltonfailure="yes">
	<test name="com.smath.sMath.AllTests"/>
	<formatter type="plain" usefile="false"/>
	<classpath refid="test.classpath"/>
    <!-- setting the filename where Comet will write coverage logs when running the instrumented classes: -->
    <jvmarg value="-Dcometinstlog=cometcoveragelog.txt"/>
	</junit>
    </target>
	
    <target name="analyze">
	<taskdef name="comet" classname="com.codign.comet.Comet" classpathref="cometclasspathid"/>
	<comet mode="analyze" javaVersion="1.5" sourceDir="src" debug="true" license="/Users/jponczak/Codign/licensetest/coview.lic" output="metrics.html" html="true" classpathref="cometclasspathid">
	<fileset dir="/Users/jponczak/Documents/workspace1/SimpleMath">
		<include name="**/*.java"/>
		<exclude name="**/*est*.java"/>
	</fileset>
	</comet>
    </target>
    <target name="instrument">
	<taskdef name="comet" classname="com.codign.comet.Comet" classpathref="cometclasspathid"/>
	<comet mode="instrument" debug="true" license="/Users/jponczak/Codign/licensetest/coview.lic" classpathref="cometclasspathid">
		<fileset dir="bin">
			<include name="**/SMath.class"/>
		</fileset>
	</comet>
    </target>

    <target name="import" description="Importing Coverage ..." depends="">
	<taskdef name="comet" classname="com.codign.comet.Comet" classpathref="cometclasspathid"/>
	<comet mode="import" includejunit="true" javaVersion="1.5" sourceDir="src" license="/Users/jponczak/Codign/licensetest/coview.lic" debug="true" output="coverage.html" html="true" classpathref="cometclasspathid">
	<fileset dir="/Users/jponczak/Documents/workspace1/SimpleMath">
		<include name="*.txt"/>
	</fileset>
	</comet>
     </target>

    <target name="importXML" description="Importing Coverage ..." depends="">
	<taskdef name="comet" classname="com.codign.comet.Comet" classpathref="cometclasspathid"/>
	<comet mode="import" includejunit="true" javaVersion="1.5" sourceDir="src" license="/Users/jponczak/Codign/licensetest/coview.lic" debug="true" output="coverage.xml" html="false" classpathref="cometclasspathid">
	<fileset dir="/Users/jponczak/Documents/workspace1/SimpleMath">
		<include name="*.txt"/>
	</fileset>
	</comet>
     </target>
</project>



