-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.xml
More file actions
188 lines (162 loc) · 6.69 KB
/
build.xml
File metadata and controls
188 lines (162 loc) · 6.69 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?xml version="1.0" encoding="UTF-8"?>
<project name="cobertura.examples.basic" default="coverage" basedir=".">
<description>
JRedmine
</description>
<property environment="env"/>
<property file="build.properties"/>
<property name="java.lib.dir" value="${env.JAVA_HOME}/lib"/>
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}">
<include name="cobertura*.jar"/>
<include name="lib/**/*.jar"/>
</fileset>
</path>
<path id="compile.classpath">
<fileset dir="${java.lib.dir}">
<include name="rt.jar"/>
</fileset>
<fileset dir="${java.lib.dir}">
<include name="tools.jar"/>
</fileset>
<fileset dir="${libs.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="/tools/lib">
<include name="*.jar"/>
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
<target name="init">
<mkdir dir="${classes.dir}"/>
<mkdir dir="${instrumented.dir}"/>
<mkdir dir="${reports.xml.dir}"/>
<mkdir dir="${reports.html.dir}"/>
<mkdir dir="${coverage.xml.dir}"/>
<mkdir dir="${coverage.summaryxml.dir}"/>
<mkdir dir="${coverage.html.dir}"/>
</target>
<target name="compile" depends="init">
<available property="sun.jpeg.present" classname="com.sun.image.codec.jpeg.JPEGCodec"/>
<javac target="1.7" srcdir="${src.dir}" destdir="${classes.dir}" source="1.7" debug="yes">
<compilerarg line="-XDignore.symbol.file"/>
<classpath refid="cobertura.classpath"/>
<classpath refid="compile.classpath"/>
</javac>
<javac target="1.7" srcdir="${test.dir}" destdir="${classes.dir}" source="1.7" debug="yes">
<compilerarg line="-XDignore.symbol.file"/>
<classpath refid="cobertura.classpath"/>
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="instrument" depends="init,compile">
<!--
Remove the coverage data file and any old instrumentation.
-->
<delete file="cobertura.ser"/>
<delete dir="${instrumented.dir}"/>
<!--
Instrument the application classes, writing the
instrumented classes into ${build.instrumented.dir}.
-->
<cobertura-instrument todir="${instrumented.dir}">
<!--
The following line causes instrument to ignore any
source line containing a reference to slf4j/logback, for the
purposes of coverage reporting.
-->
<ignore regex="org.slf4j.*"/>
<fileset dir="${classes.dir}">
<!--
Instrument all the application classes, but
don't instrument the test classes.
-->
<include name="**/*.class"/>
<exclude name="**/*Test.class"/>
</fileset>
</cobertura-instrument>
</target>
<target name="test" depends="init,compile">
<junit fork="yes" dir="${basedir}" failureProperty="test.failed">
<!--
Note the classpath order: instrumented classes are before the
original (uninstrumented) classes. This is important.
-->
<classpath location="${instrumented.dir}"/>
<classpath location="${classes.dir}"/>
<!--
The instrumented classes reference classes used by the
Cobertura runtime, so Cobertura and its dependencies
must be on your classpath.
-->
<classpath refid="cobertura.classpath"/>
<classpath refid="compile.classpath"/>
<formatter type="xml"/>
<test name="${testcase}" todir="${reports.xml.dir}" if="testcase"/>
<batchtest todir="${reports.xml.dir}" unless="testcase">
<fileset dir="${test.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${reports.xml.dir}">
<fileset dir="${reports.xml.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${reports.html.dir}"/>
</junitreport>
</target>
<target name="coverage-check">
<cobertura-check branchrate="34" totallinerate="100"/>
</target>
<target name="coverage-report">
<!--
Generate an XML file containing the coverage data using
the "srcdir" attribute.
-->
<cobertura-report srcdir="${src.dir}" destdir="${coverage.xml.dir}" format="xml"/>
</target>
<target name="summary-coverage-report">
<!--
Generate an summary XML file containing the coverage data using
the "srcdir" attribute.
-->
<cobertura-report srcdir="${src.dir}" destdir="${coverage.summaryxml.dir}" format="summaryXml"/>
</target>
<target name="alternate-coverage-report">
<!--
Generate a series of HTML files containing the coverage
data in a user-readable form using nested source filesets.
-->
<cobertura-report destdir="${coverage.html.dir}">
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
</cobertura-report>
</target>
<target name="clean" description="Remove all files created by the build/test process.">
<delete dir="${classes.dir}"/>
<delete dir="${instrumented.dir}"/>
<delete dir="${reports.dir}"/>
<delete file="cobertura.log"/>
<delete file="cobertura.ser"/>
</target>
<target name="coverage"
depends="compile,instrument,test,coverage-report,summary-coverage-report,alternate-coverage-report"
description="Compile, instrument ourself, run the tests and generate JUnit and coverage reports."/>
<target name="plantuml">
<javadoc doclet="de.mallox.doclet.PlantUMLDoclet"
docletpath="./tools/lib/plantUmlDoclet.jar"
access="private"
additionalparam=
"-J-DdestinationFile=out/uml.puml -J-DcreatePackages=false -J-DshowPublicMethods=true -J-DshowPublicConstructors=false -J-DshowPublicFields=true"
>
<packageset dir="src/main/java">
<include name="**"/>
</packageset>
</javadoc>
<java jar="./tools/lib/plantuml-jar-asl-8046.jar" fork="true" maxmemory="128m">
<arg value="out/uml.puml"/>
</java>
</target>
</project>