-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·92 lines (83 loc) · 2.95 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
81
82
83
84
85
86
87
88
89
90
91
92
<project name="Avg" default="compile" basedir=".">
<!-- Configuration for cobertura -->
<path id="cobertura.classpath">
<fileset dir="lib">
<include name="cobertura-2.0.3.jar" />
<include name="cobertura-lib/**/*.jar" />
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<!-- Target to clean up -->
<target name="clean" description="Clean">
<delete dir="bin"/>
<delete dir=".instrumented"/>
<delete dir="reports"/>
<delete>
<fileset dir="." includes="*.csv"/>
<fileset dir="." includes="*.log"/>
<fileset dir="." includes="*.ser"/>
</delete>
</target>
<!-- Target to initialize build -->
<target name="init">
<mkdir dir="bin"/>
<mkdir dir="reports"/>
</target>
<!-- Target to compile the project -->
<target name="compile" depends="init" description="Compile">
<javac includeantruntime="true"
srcdir="src"
destdir="bin"
source="1.7"
target="1.7"
compiler="javac1.7"
nowarn="true"
debug="yes">
</javac>
</target>
<!-- Target to compile the test suite -->
<target name="compile.tests" depends="compile" description="Compile all tests">
<javac includeantruntime="true"
srcdir="test"
destdir="bin"
source="1.7"
target="1.7"
compiler="javac1.7"
nowarn="true"
debug="yes">
<classpath location="lib/junit-4.11.jar"/>
</javac>
</target>
<!-- The original test target -->
<target name="test" depends="compile.tests" description="Run all unit test cases">
<echo message="Running unit tests ..."/>
<junit printsummary="true"
showoutput="true"
fork="true"
haltonfailure="false">
<formatter type="plain" usefile="false"/>
<classpath path=".instrumented"/>
<classpath path="bin"/>
<classpath location="lib/junit-4.11.jar"/>
<classpath location="lib/cobertura-2.0.3.jar"/>
<batchtest fork="true">
<fileset dir="test">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- Coverage analysis -->
<target name="coverage" description="Run coverage analysis">
<antcall target="clean" />
<antcall target="compile" />
<cobertura-instrument failOnError="true" toDir=".instrumented">
<fileset dir="bin">
<include name="**/*.class"/>
</fileset>
</cobertura-instrument>
<antcall target="test" />
<mkdir dir="reports" />
<cobertura-report format="html" destdir="reports" srcdir="src" />
</target>
</project>