<project>

    <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
        <classpath>
            <pathelement location="groovy-all-1.8.0.jar"/>
        </classpath>
    </taskdef>

    <path id="classpath.test">
        <fileset file="hamcrest-core-1.1.jar"/>
        <fileset file="groovy-all-1.8.0.jar"/>
        <fileset file="junit-dep-4.8.2.jar"/>
    </path>

    <target name="compile">
        <groovyc srcdir="." destdir="." classpathref="classpath.test" fork="yes">
           <javac debug="true"/>
        </groovyc>
    </target>

    <target name="test" depends="compile">
        <junit printsummary="yes">
            <classpath>
                <path refid="classpath.test"/>
            </classpath>
            <formatter type="plain" usefile="false"/>
            <batchtest fork="yes">
               <fileset dir=".">
                  <include name="**/*Test*.class"/>
               </fileset>
           </batchtest>
        </junit>
    </target>

</project>
