This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
build_compile.xml
268 lines (233 loc) · 10.8 KB
/
build_compile.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
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
<?xml version="1.0" encoding="utf-8"?>
<project name="JsUnit Compilation" default="create_distribution" basedir=".">
<!--
This build file is used by developers of JsUnit. It is not packaged with the JsUnit binary distribution.
-->
<property name="source_core" location="java/source_core"/>
<property name="source_client" location="java/source_client"/>
<property name="source_server" location="java/source_server"/>
<property name="source_aggregate" location="java/source_aggregate"/>
<property name="source_services" location="java/source_services"/>
<property name="tests_core" location="java/tests_core"/>
<property name="tests_client" location="java/tests_client"/>
<property name="tests_server" location="java/tests_server"/>
<property name="tests_aggregate" location="java/tests_aggregate"/>
<property name="genfiles_client" location="java/genfiles_client"/>
<property name="bin" location="java/bin"/>
<property name="lib" location="java/lib"/>
<property name="testlib" location="java/testlib"/>
<path id="classpath">
<fileset dir="${lib}">
<include name="*.jar"/>
<include name="*/*.jar"/>
</fileset>
<fileset dir="${bin}">
<include name="jsunit.jar"/>
</fileset>
</path>
<taskdef resource="axis-tasks.properties" classpathref="classpath"/>
<target name="run_unit_tests" depends="clean,run_core_tests,run_server_tests,run_aggregate_tests,run_client_tests"/>
<path id="self_tests_classpath">
<fileset dir="${lib}">
<include name="*.jar"/>
<include name="*/*.jar"/>
</fileset>
<fileset dir="${testlib}">
<include name="*.jar"/>
</fileset>
</path>
<path id="lib_classpath">
<fileset dir="${lib}">
<include name="*.jar"/>
<include name="*/*.jar"/>
</fileset>
</path>
<target name="run_core_tests" depends="compile_core_tests">
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
failureproperty="junit_test_failed">
<formatter type="plain" usefile="false"/>
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}"/>
<test name="net.jsunit.CoreUnitTestSuite"/>
</junit>
<fail if="junit_test_failed"/>
</target>
<target name="run_server_tests" depends="compile_server_tests">
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
failureproperty="junit_test_failed">
<formatter type="plain" usefile="false"/>
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}"/>
<test name="net.jsunit.ServerUnitTestSuite"/>
</junit>
<fail if="junit_test_failed"/>
</target>
<target name="run_aggregate_tests" depends="compile_aggregate_tests">
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
failureproperty="junit_test_failed">
<formatter type="plain" usefile="false"/>
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}"/>
<test name="net.jsunit.AggregateServerUnitTestSuite"/>
</junit>
<fail if="junit_test_failed"/>
</target>
<target name="run_client_tests" depends="compile_client_tests">
<junit fork="yes" haltonfailure="false" forkmode="once" showoutput="yes" printsummary="withOutAndErr"
failureproperty="junit_test_failed">
<formatter type="plain" usefile="false"/>
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}"/>
<test name="net.jsunit.ClientUnitTestSuite"/>
</junit>
<fail if="junit_test_failed"/>
</target>
<target name="clean">
<delete dir="${bin}/net"/>
<delete dir="${genfiles_client}/net"/>
</target>
<target name="compile_source" depends="clean,compile_source_server,compile_source_aggregate,compile_source_client"/>
<target name="compile_tests" depends="compile_core_tests,compile_server_tests,compile_aggregate_tests"/>
<target name="compile_source_server" depends="compile_source_core">
<javac srcdir="${source_server}" destdir="${bin}" debug="true">
<classpath refid="lib_classpath"/>
<classpath>
<path location="${bin}"/>
</classpath>
</javac>
</target>
<target name="compile_source_aggregate" depends="compile_source_server">
<javac srcdir="${source_aggregate}" destdir="${bin}" debug="true">
<classpath refid="lib_classpath"/>
<classpath>
<path location="${bin}"/>
</classpath>
</javac>
</target>
<target name="compile_source_services" depends="compile_source_core">
<javac srcdir="${source_client}" destdir="${bin}" debug="true">
<classpath refid="lib_classpath"/>
<classpath>
<path location="${bin}"/>
</classpath>
<include name="net/jsunit/services/TestRunService.java"/>
</javac>
</target>
<target name="compile_source_client"
depends="compile_source_services,generate_wsdl,generate_client_java_from_wsdl">
<javac srcdir="${genfiles_client}" destdir="${bin}" debug="true">
<classpath refid="lib_classpath"/>
</javac>
<javac srcdir="${source_client}" destdir="${bin}" debug="true">
<classpath refid="lib_classpath"/>
<classpath>
<path location="${bin}"/>
</classpath>
</javac>
</target>
<target name="compile_source_core">
<javac srcdir="${source_core}" destdir="${bin}" debug="true">
<classpath refid="lib_classpath"/>
</javac>
</target>
<target name="generate_wsdl">
<axis-java2wsdl
namespace="https://services.jsunit.net/services"
classname="net.jsunit.services.TestRunService"
output="TestRunService.wsdl"
location="https://services.jsunit.net/services/TestRunService">
<classpath>
<path location="${bin}"/>
</classpath>
<classpath refid="lib_classpath"/>
<mapping package="net.jsunit.model" namespace="https://services.jsunit.net/model"/>
<mapping package="net.jsunit.services" namespace="https://services.jsunit.net/services"/>
</axis-java2wsdl>
</target>
<target name="generate_client_java_from_wsdl">
<axis-wsdl2java output="${genfiles_client}" url="TestRunService.wsdl">
<classpath>
<path location="${bin}"/>
</classpath>
<classpath refid="lib_classpath"/>
<mapping package="net.jsunit.services" namespace="https://services.jsunit.net/services"/>
<mapping package="net.jsunit.model" namespace="https://services.jsunit.net/model"/>
<nsexclude namespace="https://services.jsunit.net/model"/>
</axis-wsdl2java>
<delete file="${genfiles_client}/net/jsunit/services/TestRunService.java"/>
</target>
<target name="compile_core_tests" depends="compile_source_core">
<javac srcdir="${tests_core}" destdir="${bin}" debug="true">
<classpath refid="self_tests_classpath"/>
</javac>
</target>
<target name="compile_server_tests" depends="compile_source_server">
<javac srcdir="${tests_server}" destdir="${bin}" debug="true">
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}"/>
</javac>
</target>
<target name="compile_aggregate_tests" depends="compile_source_aggregate">
<javac srcdir="${tests_server}" destdir="${bin}" debug="true">
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}"/>
</javac>
<javac srcdir="${tests_aggregate}" destdir="${bin}" debug="true">
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}"/>
</javac>
</target>
<target name="compile_client_tests" depends="compile_source_client">
<javac srcdir="${tests_client}" destdir="${bin}" debug="true">
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}"/>
</javac>
</target>
<target name="create_src_jar">
<jar jarfile="./java/jsunit-src.jar">
<fileset dir="${source_core}"/>
<fileset dir="${source_client}"/>
<fileset dir="${source_server}"/>
<fileset dir="${tests_core}"/>
<fileset dir="${tests_client}"/>
<fileset dir="${tests_server}"/>
</jar>
</target>
<target name="generateJsUnitPropertiesSample" description="Generates the jsunit.properties.sample file">
<xslt in="build.xml" out="jsunit.properties.sample" destdir="."
style="tools/buildDotXmlToJsUnitDotProperties.xsl"></xslt>
</target>
<target name="transformResultXmlUsingSkin">
<xslt in="tools/sample_xml/distributedResult.xml" out="result.html" destdir="."
style="skins/HTML.xsl"></xslt>
</target>
<target name="make_jar" depends="compile_source">
<jar jarfile="${bin}/jsunit.jar" basedir="${bin}" includes="net/**"/>
<delete dir="${bin}/net"/>
</target>
<target name="make_all_jar" depends="compile_source,compile_tests">
<jar jarfile="${bin}/jsunit_all.jar" basedir="${bin}" includes="net/**"/>
<delete dir="${bin}/net"/>
</target>
<target name="create_distribution" depends="clean,make_jar,create_zip"
description="Creates the JsUnit distribution"/>
<target name="create_zip" description="Create a zip of the project">
<zip destfile="jsunit.zip">
<zipfileset dir="." filemode="755">
<include name="bin/unix/*.sh"/>
<include name="bin/mac/*.sh"/>
</zipfileset>
<zipfileset dir=".">
<include name="**"/>
<exclude name="bin/unix/*.sh"/>
<exclude name="bin/mac/*.sh"/>
<exclude name="**/.svn"/>
<exclude name="**/*.java"/>
<exclude name="uploaded/**"/>
<exclude name="TEST-*.xml"/>
<exclude name="**/*.class"/>
<exclude name="logs/**"/>
</zipfileset>
</zip>
</target>
</project>