-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
85 lines (72 loc) · 2.79 KB
/
build.xml
File metadata and controls
85 lines (72 loc) · 2.79 KB
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
81
82
83
84
85
<!--
Project directory structure:
build.xml : this file
.gitignore: git ignore files for Java (EECS 293 version).
This is a hidden file, but do not ignore!
src/ : source .java files
Generated directories
build/ : .class files
$ANT_HOME/lib must contain (see Ant-JUnit and JaCoCo installation guides):
ant-junit4.jar
ant-junit.jar
hamcrest-core-1.3.jar
junit-4.12.jar
jacocoant.jar
-->
<project name="planning" xmlns:jacoco="antlib:org.jacoco.ant">
<!-- Directory with source files -->
<property name="src.dir" value="src"/>
<!-- Directories with the class files -->
<property name="build.dir" value="build"/>
<!-- Directories and files with the reports on unit test and code coverage -->
<property name="report.dir" value="report"/>
<property name="junit.dir" value="${report.dir}/junit"/>
<property name="jacoco.dir" value="${report.dir}/jacoco"/>
<property name="jacoco.file" value="${jacoco.dir}/jacoco.exec"/>
<!-- Additional jar that may be needed for properly runnign junit -->
<path id="hamcrest.classpath">
<pathelement location="${ant.home}/lib/hamcrest-core-1.3.jar"/>
</path>
<!-- ant build : compile the src -->
<target name="build">
<mkdir dir="${build.dir}"/>
<javac srcdir="${src.dir}" destdir="${build.dir}" debug="true" includeAntRuntime="yes"/>
</target>
<!-- ant test : run unit tests -->
<target name="test" depends="build">
<mkdir dir="${report.dir}"/>
<mkdir dir="${junit.dir}"/>
<mkdir dir="${jacoco.dir}"/>
<jacoco:coverage destfile="${jacoco.file}">
<junit fork="yes" includeAntRuntime="yes" printsummary="withOutAndErr">
<formatter type="xml"/>
<batchtest fork="yes" filtertrace="off" todir="${junit.dir}">
<fileset dir="${build.dir}" includes="**/*Test.class"/>
</batchtest>
<classpath refid="hamcrest.classpath"/>
<classpath path="${build.dir}"/>
</junit>
</jacoco:coverage>
</target>
<!-- ant report : generate the JUnit and code coverage reports -->
<target name="report" depends="test">
<junitreport todir="${junit.dir}">
<fileset dir="${junit.dir}" includes="TEST-*.xml"/>
<report todir="${junit.dir}"/>
</junitreport>
<jacoco:report>
<executiondata>
<file file="${jacoco.file}"/>
</executiondata>
<structure name="${ant.project.name}">
<classfiles>
<fileset dir="${build.dir}"/>
</classfiles>
<sourcefiles>
<fileset dir="${src.dir}"/>
</sourcefiles>
</structure>
<html destdir="${jacoco.dir}"/>
</jacoco:report>
</target>
</project>