-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
80 lines (71 loc) · 2.91 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0" encoding="UTF-8"?>
<project name="projx" default="all" basedir=".">
<description>Builds, tests, and runs projx</description>
<property name="build.dir" value="./"/>
<property name="src.dir" location="${build.dir}/src"/>
<property name="test.dir" location="${build.dir}/test"/>
<property name="test.htmlreports.dir" location="${build.dir}/test/htmlreports"/>
<property name="test.data.dir" location="${build.dir}/test/data"/>
<property name="junit.class.name" value="DescriptiveStatisticsTest"/>
<!-- Classpath to find java packages
<path id="classpath.base">
<pathelement location="/opt/java/lib/junit-4.10.jar" />
</path> -->
<!-- Classpath for tests to find src packages -->
<path id="classpath.src">
<pathelement location="src" />
</path>
<path id="classpath.junittest">
<path refid="classpath.base" />
<pathelement location="/opt/java/lib/junit-4.10.jar" />
<pathelement location="${test.dir}" />
</path>
<target name="clean" description="Remove all .class files">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${src.dir}">
<include name="**/*.class"/>
</fileset>
<fileset dir="${test.dir}">
<include name="**/*.class"/>
</fileset>
<fileset dir="${test.htmlreports.dir}">
<include name="**/*.txt"/>
<include name="**/*.xml"/>
<include name="**/*.html"/>
</fileset>
</delete>
</target>
<target name="compile">
<javac srcdir="${src.dir}" destdir="${src.dir}" debug="true" includeAntRuntime="false">
<classpath refid="classpath.base"/>
<include name="**/*.java"/>
</javac>
</target>
<target name="compile-test" depends="compile">
<javac srcdir="${test.dir}" destdir="${test.dir}" debug="true" includes="${src.dir}" includeAntRuntime="false">
<classpath refid="classpath.base"/>
<classpath refid="classpath.src"/>
<classpath refid="classpath.junittest"/>
<include name="**/*.java"/>
</javac>
</target>
<target name="test" depends="compile-test">
<mkdir dir="${test.data.dir}"/>
<mkdir dir="${test.htmlreports.dir}"/>
<junit fork="yes" haltonfailure="no" showoutput="yes" printsummary="true">
<test name="${junit.class.name}" todir="${test.data.dir}"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<classpath refid="classpath.base" />
<classpath refid="classpath.src" />
<classpath refid="classpath.junittest" />
</junit>
<junitreport todir="${test.htmlreports.dir}">
<fileset dir="${test.data.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.htmlreports.dir}"/>
</junitreport>
</target>
<target name="all" depends="compile-test" />
</project>