<project name="Perl6-MetaModel" default="test" basedir=".">
    
    <description>
        The Perl 6 MetaModel.
    </description>
    
    <property name="src" location="src" />
    <property name="build" location="build" />
    <property name="coverage" location="coverage" />     

    <target name="init" depends="clean">
        <mkdir dir="${build}" />
    </target>
    
    <target name="compile" depends="init">
        <javac 
            srcdir="${src}" 
            destdir="${build}"
            />
    </target>
    
    <target name="test" depends="compile">
        <junit fork="yes" haltonfailure="yes">
            <test name="org.perl6.metamodel.tests.AllTests" />
            <formatter type="plain" usefile="false" />
            <classpath location="${build}" />
        </junit>
    </target>   
    
    <target name="cover" depends="compile">
        <java classname="emmarun">
            <arg line="-r html -sp ${src} -cp ${build}" />
            <arg value="org.perl6.metamodel.tests.AllTests" />
        </java>        
    </target>
    
    <target name="clean">
        <delete dir="${build}" />
        <delete dir="${coverage}" />        
    </target>
    
</project>