-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
78 lines (66 loc) · 3.16 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="pathashala" default="runjUnit" basedir=".">
<path id="test.compile.classpath" description="classpath for compiling test-sources">
<pathelement location="out/classes" />
<pathelement location="lib/junit-4.12.jar" />
<pathelement location="lib/system-rules-1.12.0.jar" />
<pathelement location="lib/mockito-all-1.9.5.jar" />
</path>
<path id="test.runtime.classpath" description="classpath for running junit-tests">
<pathelement location="out/testclasses" />
<pathelement location="out/classes" />
<pathelement location="out/instrumentedclasses" />
<pathelement location="lib/junit-4.12.jar" />
<pathelement location="lib/system-rules-1.12.0.jar" />
<pathelement location="lib/mockito-all-1.9.5.jar" />
<pathelement location="lib/hamcrest-all-1.1.jar" />
</path>
<path id="cobertura.classpath" description="classpath for instrumenting classes">
<pathelement location="lib/cobertura-2.0.3.jar" />
<fileset dir="lib">
<include name="cobertura-dependencies/*.jar" />
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<target name="clean">
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="out" />
</delete>
</target>
<target name="prepare" depends="clean">
<mkdir dir="out" />
<mkdir dir="out/classes" />
<mkdir dir="out/testclasses" />
<mkdir dir="out/reports" />
<mkdir dir="out/reports/junit" />
<mkdir dir="out/reports/cobertura" />
</target>
<target name="compile.sources" depends="prepare">
<javac srcdir="src" destdir="out/classes" debug="on" fork="true" includeantruntime="no" />
</target>
<target name="instrument.classes" depends="compile.sources">
<cobertura-instrument todir="out/instrumentedclasses" datafile="out/cobertura.ser">
<includeclasses regex=".*" />
<instrumentationClasspath>
<pathelement location="out/classes" />
</instrumentationClasspath>
</cobertura-instrument>
</target>
<target name="compile.tests" depends="instrument.classes">
<javac classpathref="test.compile.classpath" srcdir="test" destdir="out/testclasses" debug="on" fork="true" includeantruntime="no" />
</target>
<target name="runjUnit" depends="compile.tests">
<junit fork="yes" forkmode="once" printsummary="yes" haltonfailure="yes" showoutput="true">
<formatter type="plain" usefile="no" />
<classpath refid="test.runtime.classpath" />
<batchtest todir="out/reports/junit">
<fileset dir="test">
<include name="**/*Test.java" />
</fileset>
</batchtest>
<sysproperty key="net.sourceforge.cobertura.datafile" file="out/cobertura.ser" />
<classpath refid="cobertura.classpath" />
</junit>
<cobertura-report format="html" destdir="out/reports/cobertura" datafile="out/cobertura.ser" srcdir="src" />
</target>
</project>