forked from glmars/junit-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
277 lines (251 loc) · 10.3 KB
/
build.xml
File metadata and controls
277 lines (251 loc) · 10.3 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- Build file for the JUnit-addons Project.
-
- This script should be started with the following command line :
-
- ant <target>
-
- Run "ant -projecthelp" to get a list of available targets.
-
- Version: $Revision: 1.19 $ $Date: 2005/04/15 01:03:37 $
- Author: Vladimir R. Bossicard (vbossica@users.sourceforge.net)
-->
<project name="junit-addons" default="build" basedir=".">
<property file="build-local.properties"/>
<property file="build.properties" />
<property file="common.properties" />
<!-- directories settings -->
<property name="src" value="src" />
<property name="main.src" value="src/main" />
<property name="test.src" value="src/test" />
<property name="example.src" value="src/example" />
<property name="build.dest" value="build" />
<property name="api.dest" value="${build.dest}/api" />
<property name="classes.dest" value="${build.dest}/classes" />
<property name="classes.instrumented.dest" value="${build.dest}/classes-instrumented" />
<property name="test.classes.dest" value="${build.dest}/classes-test" />
<property name="example.classes.dest" value="${build.dest}/classes-example" />
<property name="dist.dest" value="dist" />
<!-- miscellaneous settings -->
<property name="compilation.debug" value="on" />
<property name="compilation.deprecation" value="off" />
<property name="compilation.verbose" value="off" />
<!--
- Initializes the build and check if all libraries are available.
-->
<target name="init">
<tstamp/>
<mkdir dir="${build.dest}" />
<mkdir dir="${classes.dest}" />
<mkdir dir="${test.classes.dest}" />
<mkdir dir="${example.classes.dest}" />
<mkdir dir="${api.dest}" />
<mkdir dir="${dist.dest}" />
</target>
<path id="libraries">
<pathelement location="${jdom.jar}" />
<pathelement location="${jaxen.jar}" />
<pathelement location="${saxpath.jar}" />
<pathelement location="${ant.jar}" />
<pathelement location="${junit.jar}" />
<pathelement location="${xerces.jar}" />
<pathelement location="${xml-apis.jar}" />
<pathelement location="${commons-logging.jar}" />
</path>
<!--
- Compiles the source code to the build dir
- Copy all other resources to the build dir
- which are needed to run the application alone
-->
<target name="build"
depends="init"
description="compiles the junit-addons classes">
<javac srcdir="${main.src}"
destdir="${classes.dest}"
debug="${compilation.debug}"
verbose="${compilation.verbose}"
deprecation="${compilation.deprecation}">
<classpath>
<path refid="libraries"/>
</classpath>
</javac>
<javac srcdir="${example.src}"
destdir="${example.classes.dest}"
debug="${compilation.debug}"
verbose="${compilation.verbose}"
deprecation="${compilation.deprecation}">
<classpath>
<pathelement location="${classes.dest}" />
<path refid="libraries"/>
</classpath>
</javac>
<javac srcdir="${test.src}"
destdir="${test.classes.dest}"
debug="${compilation.debug}"
verbose="${compilation.verbose}"
deprecation="${compilation.deprecation}">
<classpath>
<pathelement location="${classes.dest}" />
<pathelement location="${example.classes.dest}" />
<path refid="libraries"/>
</classpath>
</javac>
</target>
<target name="test"
depends="build"
description="tests the junit-addons classes">
<java classname="junitx.runner.TestRunner" fork="yes">
<jvmarg value="-DPropertyManager.file=${test.src}/conf/tests.properties" />
<jvmarg value="-DXMLPropertyManager.file=${test.src}/conf/tests.xml" />
<arg line="-verbose" />
<arg line="-runner.properties ${test.src}/conf/runner.properties" />
<arg line="-test.properties ${test.src}/conf/tests.properties" />
<arg line="-class AllTests" />
<classpath>
<pathelement location="${classes.instrumented.dest}"/>
<pathelement location="${classes.dest}" />
<pathelement location="${test.classes.dest}" />
<pathelement location="${example.classes.dest}" />
<pathelement location="${example.src}" />
<pathelement location="${junit-addons-runner.jar}" />
<path refid="libraries"/>
<path refid="jcoverage.classpath"/>
</classpath>
</java>
</target>
<target name="test-old"
depends="build">
<!--
<java classname="junit.textui.TestRunner" fork="yes">
<arg line="-class AllTests" />
<jvmarg value="-DPropertyManager.file=${test.src}/conf/tests.properties" />
<jvmarg value="-DXMLPropertyManager.file=${test.src}/conf/tests.xml" />
<classpath>
<pathelement location="${classes.dest}" />
<pathelement location="${test.classes.dest}" />
<pathelement location="${example.classes.dest}" />
<pathelement location="${example.src}" />
<path refid="libraries"/>
</classpath>
</java>
-->
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<jvmarg value="-DPropertyManager.file=${test.src}/conf/tests.properties" />
<jvmarg value="-DXMLPropertyManager.file=${test.src}/conf/tests.xml" />
<formatter type="xml"/>
<test name="AllTests"/>
<classpath>
<pathelement location="${classes.dest}" />
<pathelement location="${test.classes.dest}" />
<pathelement location="${example.classes.dest}" />
<pathelement location="${example.src}" />
<path refid="libraries"/>
</classpath>
</junit>
</target>
<target name="example"
depends="build"
description="compiles and runs the examples">
<javac srcdir="${example.src}"
destdir="${test.classes.dest}"
debug="${compilation.debug}"
verbose="${compilation.verbose}"
deprecation="${compilation.deprecation}">
<classpath>
<pathelement location="${classes.dest}" />
<path refid="libraries"/>
</classpath>
</javac>
<java classname="junitx.tool.TestClassValidator" fork="yes">
<arg line="junitx.example.ValidationExample" />
<classpath>
<pathelement location="${classes.dest}" />
<pathelement location="${test.classes.dest}" />
<path refid="libraries"/>
</classpath>
</java>
</target>
<path id="jcoverage.classpath">
<pathelement location="${jcoverage.home}/jcoverage.jar"/>
<pathelement location="${jcoverage.home}/lib/log4j/1.2.8/log4j-1.2.8.jar"/>
<pathelement location="${jcoverage.home}/lib/bcel/5.1/bcel.jar"/>
<pathelement location="${jcoverage.home}/lib/oro/2.0.7/jakarta-oro-2.0.7.jar"/>
<pathelement location="${jcoverage.home}/lib/gnu/getopt/1.0.9/java-getopt-1.0.9.jar"/>
</path>
<taskdef resource="tasks.properties">
<classpath>
<path refid="jcoverage.classpath"/>
</classpath>
</taskdef>
<target name="instrument" depends="build">
<instrument todir="${classes.instrumented.dest}">
<fileset dir="${classes.dest}">
<exclude name="junitx/ant/*.class"/>
<exclude name="junitx/tool/*.class"/>
</fileset>
</instrument>
</target>
<target name="coverage" depends="instrument, test">
<report srcdir="${main.src}" destdir="${build.dest}/jcoverage"/>
</target>
<!--
- Generates the junit-addons API
-->
<target name="javadocs"
depends="build"
description="generates the API">
<javadoc
packagenames="junitx.*"
sourcepath="${main.src}"
destdir="${api.dest}"
overview="${main.src}/overview.html"
author="true"
version="true"
protected="true"
use="false"
windowtitle="${project.title} v${project.version}"
doctitle="${project.title}, version ${project.version}<br>API specification"
header="<b>${project.title}<br>version ${project.version}</b>"
bottom="Copyright &#169; ${project.year} ${project.holder}. All Rights Reserved.">
<classpath>
<path refid="libraries"/>
</classpath>
</javadoc>
</target>
<!--
- Generates a jar archive with the content of the build directory
-->
<target name="release"
depends="clean, build, test, javadocs"
description="Generate the junit-addons jar archive" >
<delete quiet="true">
<fileset dir="${dist.dest}/" includes="${project.name}-${project.version}.jar" />
</delete>
<jar jarfile="${dist.dest}/${project.name}-${project.version}.jar"
basedir="${classes.dest}" >
<manifest>
<attribute name="Implementation-Vendor"
value="${project.holder}" />
<attribute name="Implementation-Version"
value="${project.version}" />
<attribute name="Implementation-Title"
value="${project.title}" />
</manifest>
</jar>
<zip zipfile="${dist.dest}/${project.name}-${project.version}.jar"
update="yes">
<zipfileset dir="." includes="LICENSE" prefix="META-INF" />
</zip>
<zip zipfile="${dist.dest}/src.jar">
<zipfileset dir="${src}" excludes="**/sflogo.png" prefix="src" />
</zip>
</target>
<!--
- Delete all generate directories and their content
-->
<target name="clean">
<delete dir="${build.dest}" quiet="true" />
<delete dir="${dist.dest}" quiet="true" />
</target>
</project>