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
223 lines (194 loc) · 8.46 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
<?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_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_server" location="java/tests_server"/>
<property name="tests_aggregate" location="java/tests_aggregate"/>
<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>
<target name="run_unit_tests" depends="clean,run_core_tests,run_server_tests,run_aggregate_tests"/>
<target name="run_integration_tests_selenium_local">
<ant target="selenium_test">
<property name="seleniumConfigFilePath" value="./selenium.yml"/>
<property name="seleniumEnvironment" value="local"/>
</ant>
</target>
<target name="run_integration_tests_selenium_sauce">
<ant target="selenium_test">
<property name="seleniumConfigFilePath" value="./selenium.yml"/>
<property name="seleniumEnvironment" value="saucelabs"/>
</ant>
</target>
<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="clean">
<delete file="jsunit.zip"/>
<delete dir="${bin}/jsunit.jar"/>
<delete dir="${bin}/jsunit_tests.jar"/>
<delete dir="${bin}/net"/>
</target>
<target name="compile_source" depends="clean,compile_source_server,compile_source_aggregate"/>
<target name="compile_tests_against_jar">
<javac srcdir="${tests_core}" destdir="${bin}" debug="true">
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}/jsunit.jar"/>
</javac>
<javac srcdir="${tests_server}" destdir="${bin}" debug="true">
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}/jsunit.jar"/>
</javac>
<javac srcdir="${tests_aggregate}" destdir="${bin}" debug="true">
<classpath refid="self_tests_classpath"/>
<classpath path="${bin}/jsunit.jar"/>
</javac>
</target>
<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_core">
<javac srcdir="${source_core}" destdir="${bin}" debug="true">
<classpath refid="lib_classpath"/>
</javac>
</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="create_src_jar">
<jar jarfile="./java/jsunit-source.jar">
<fileset dir="${source_core}"/>
<fileset dir="${source_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="make_jar" depends="compile_source">
<jar jarfile="${bin}/jsunit.jar" basedir="${bin}" includes="net/**"/>
<delete dir="${bin}/net"/>
</target>
<target name="make_tests_jar" depends="make_jar,compile_tests_against_jar">
<jar jarfile="${bin}/jsunit_tests.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">
<zip destfile="jsunit.zip" filesonly="true">
<zipfileset dir="." filemode="755" prefix="jsunit">
<include name="bin/unix/*.sh"/>
<include name="bin/mac/*.sh"/>
</zipfileset>
<zipfileset dir="." prefix="jsunit">
<include name="**"/>
<exclude name="bin/unix/*.sh"/>
<exclude name="bin/mac/*.sh"/>
<exclude name="**/.svn"/>
<exclude name="**/*.java"/>
<exclude name="uploaded/**"/>
<exclude name="java/testlib/**"/>
<exclude name="java/bin/jsunit_tests.jar"/>
<exclude name="TEST-*.xml"/>
<exclude name="**/*.class"/>
<exclude name="logs/**"/>
<exclude name="intellij/**"/>
<exclude name="tools/**"/>
<exclude name="build_compile.xml"/>
<exclude name="JsUnit.ipr"/>
<exclude name="JsUnit.iws"/>
<exclude name="todo.txt"/>
<exclude name="changelog.txt"/>
</zipfileset>
</zip>
</target>
</project>