forked from Java-SNePS/Java-SNePS-3.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
80 lines (66 loc) · 2.63 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
<project name="java-sneps" xmlns:jacoco="antlib:org.jacoco.ant">
<property name="main.build.dir" value="build/"/>
<property name="main.src.dir" value="src/"/>
<property name="test.build.dir" value="build/test"/>
<property name="test.src.dir" value="tests/"/>
<property name="result.report.dir" location="site/jacoco/" />
<property name="result.exec.file" location="jacoco.exec" />
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="lib/jacocoant.jar"/>
</taskdef>
<path id="classpath.test">
<pathelement location="lib/junit.jar"/>
<pathelement location="lib/hamcrest.jar"/>
<pathelement location="lib/java-cup-11b.jar"/>
<pathelement location="lib/java-cup-11b-runtime.jar"/>
<pathelement location="${main.build.dir}"/>
<fileset dir="lib/">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="compile">
<mkdir dir="${main.build.dir}"/>
<javac srcdir="${main.src.dir}" destdir="${main.build.dir}" includeantruntime="false" debug="on">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test-compile" depends="compile">
<mkdir dir="${test.build.dir}"/>
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" includeantruntime="false" debug="on">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test" depends="test-compile">
<jacoco:coverage destfile="${result.exec.file}">
<junit printsummary="on" haltonfailure="yes" haltonerror="yes" fork="true">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${test.build.dir}"/>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.build.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
</jacoco:coverage>
<jacoco:report>
<!-- This task needs the collected execution data and ... -->
<executiondata>
<file file="${result.exec.file}" />
</executiondata>
<!-- the class files and optional source files ... -->
<structure name="JaCoCo Ant Example">
<classfiles>
<fileset dir="${main.build.dir}" />
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${main.src.dir}" />
</sourcefiles>
</structure>
<!-- to produce reports in different formats. -->
<html destdir="${result.report.dir}" />
<csv destfile="${result.report.dir}/report.csv" />
<xml destfile="${result.report.dir}/report.xml" />
</jacoco:report>
</target>
</project>