compiler-design-eth/build.xml

72 lines
2.6 KiB
XML
Raw Normal View History

2020-01-15 22:32:25 +01:00
<project name="compiler-design" default="test" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
2020-01-15 22:18:07 +01:00
<!-- A very simple ant file that primarily exists to run cup and lex;
it also includes targets to build the compiler and run tests for those
who would rather not use Eclipse -->
<!-- Set project properties. -->
<property name="src.dir" value="${basedir}/src"/>
<property name="test.dir" value="${basedir}/test"/>
<property name="javali_tests.dir" value="${basedir}/javali_tests"/>
<property name="parser.jar" value="${basedir}/lib/javaliParserObf.jar"/>
<property name="build.dir" value="${basedir}/bin"/>
<property name="junit.jar" value="${basedir}/lib/junit-4.12.jar"/>
<property name="hamcrest.jar" value="${basedir}/lib/hamcrest-core-1.3.jar"/>
2020-01-15 22:32:25 +01:00
<property name="antlr.jar" value="${basedir}/lib/antlr-4.4-complete.jar"/>
2020-01-15 22:18:07 +01:00
<property name="antlr.profile" value="false"/>
<property name="antlr.report" value="false"/>
<!-- Cleans generated code, but NOT the parser source! -->
<target name="clean">
<delete dir="${build.dir}"/>
</target>
2020-01-15 22:34:57 +01:00
<target name="compile">
<mkdir dir="${build.dir}"/>
2020-01-15 22:18:07 +01:00
2020-01-15 22:34:57 +01:00
<javac debug="true" destdir="${build.dir}" includeantruntime="false">
<src path="${src.dir}"/>
<src path="${test.dir}"/>
<classpath>
<pathelement location="${antlr.jar}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${hamcrest.jar}"/>
<pathelement location="${parser.jar}"/>
</classpath>
</javac>
</target>
2020-01-15 22:18:07 +01:00
<!-- Deletes all byproducts of running the tests -->
<target name="clean-test">
<delete>
<fileset dir="${javali_tests.dir}" includes="**/*.err"/>
<fileset dir="${javali_tests.dir}" includes="**/*.s"/>
<fileset dir="${javali_tests.dir}" includes="**/*.bin"/>
<fileset dir="${javali_tests.dir}" includes="**/*.dot"/>
<fileset dir="${javali_tests.dir}" includes="**/*.exe"/>
2020-01-15 22:34:57 +01:00
<fileset dir="${javali_tests.dir}" includes="**/*.ref"/>
2020-01-15 22:18:07 +01:00
</delete>
</target>
<!-- Runs the tests. Use the compile target first! -->
<target name="test" depends="compile">
2020-01-15 22:34:57 +01:00
<junit fork="true" forkmode="once" failureproperty="tests-failed" outputtoformatters="false">
<formatter type="brief" usefile="false"/>
<batchtest skipNonTests="true">
<fileset dir="bin" includes="**/*.class" />
</batchtest>
<assertions enablesystemassertions="true" />
<sysproperty key="cd.meta_hidden.Version" value="REFERENCE" />
<classpath>
<pathelement location="${build.dir}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${hamcrest.jar}"/>
<pathelement location="${antlr.jar}"/>
<pathelement location="${parser.jar}"/>
</classpath>
</junit>
<fail if="tests-failed" />
2020-01-15 22:32:25 +01:00
</target>
2020-01-15 22:18:07 +01:00
</project>