-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
executable file
·408 lines (346 loc) · 18.5 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
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<?xml version="1.0"?>
<project name="openspaces" default="usage" basedir=".">
<property file="project.properties"/>
<property file="build.properties"/>
<property environment="env"/>
<property name="checkouts.dir" value="${basedir}/../.." />
<property name="core.dir" value="core" />
<condition property="mvn.executable" value="mvn.bat">
<os family="windows" />
</condition>
<condition property="mvn.executable" value="mvn">
<os family="unix" />
</condition>
<path id="all-libs">
<fileset dir="${basedir}/deploy">
<include name="**/*.jar"/>
</fileset>
<!-- OpenJPA jars must come prior to ejb jars in classpath list, otherwise jpa classes
will not compile due to interface PersistenceProvider conflict -->
<fileset dir="${lib.dir}">
<include name="**/jpa/*.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
<exclude name="required/gs-openspaces.jar"/>
<exclude name="optional/openspaces/**"/>
<exclude name="platform/openspaces/**"/>
<exclude name="ant/**"/>
</fileset>
<path path="${basedir}/tools/groovy/embeddable/groovy-all-1.8.6.jar" />
<path path="${basedir}/../${core.dir}/classes" />
<path path="${basedir}/../${core.dir}/src/java/resources" />
</path>
<path id="javadoc-libs">
<path path="${target.classes.dir}" />
<path path="${basedir}/../${core.dir}/classes" />
</path>
<path id="tests-libs">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
<exclude name="platform/ant/*.jar"/>
<exclude name="required/gs-openspaces.jar"/>
<exclude name="optional/openspaces/**"/>
<exclude name="platform/openspaces/**"/>
<exclude name="ant/**"/>
</fileset>
<fileset dir="${deploy.templates.dir}">
<include name="**/*.jar"/>
</fileset>
<path path="${basedir}/tools/groovy/embeddable/groovy-all-1.8.6.jar" />
<path path="${basedir}/../${core.dir}" />
<path path="${basedir}/../${core.dir}/classes" />
<path path="${basedir}/../${core.dir}/src/java/resources" />
</path>
<target name="usage">
<echo message=""/>
<echo message="OpenSpaces build script"/>
<echo message="-----------------------------------------"/>
<echo message=""/>
<echo message="Among the available targets are:"/>
<echo message=""/>
<echo message="clean --> Cleans all output dirs"/>
<echo message="build --> build all; don't create JARs"/>
<echo message="tests --> run tests"/>
<echo message="dist --> create a distribution"/>
<echo message=""/>
</target>
<target name="clean" description="Clean all output dirs (dist, javadocs, classes, test-classes, etc)">
<!-- Just kill target dir (it's safer). No need at this point to keep it. -->
<delete dir="${target.dir}"/>
<exec executable="${env.M2_HOME}\bin\${mvn.executable}">
<arg line="clean -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
</target>
<!--
########### COMPILE TARGETS ###########
-->
<target name="buildmain" description="Compile main source tree java files into class files">
<echo message="productversion=${productversion}"/>
<echo message="maven.repo.local=${maven.repo.local}"/>
<exec executable="${env.M2_HOME}\bin\${mvn.executable}" failonerror="true">
<arg line="package -P perm-gen -Dmaven.repo.local=${maven.repo.local}" />
</exec>
<exec executable="${env.M2_HOME}\bin\${mvn.executable}">
<arg line="install:install-file -DgroupId=com.gigaspaces -DartifactId=gs-openspaces -DcreateChecksum=true -Dversion=${productversion} -Dpackaging=jar -DpomFile=${basedir}/pom.xml -Dfile=${target.dir}/gs-openspaces.jar -DskipTests -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
<exec executable="${env.M2_HOME}\bin\${mvn.executable}">
<arg line="install:install-file -DgroupId=com.gigaspaces -DartifactId=gs-openspaces -DcreateChecksum=true -Dversion=${productversion} -Dpackaging=jar -DpomFile=${basedir}/pom.xml -Dclassifier=tests -Dfile=${target.dir}/gs-openspaces-${productversion}-tests.jar -DskipTests -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
</target>
<target name="build_1_5" depends="clean, buildmain" description="Compile main sources"/>
<target name="srczip" description="Create source ZIP (containing Java sources)">
<mkdir dir="${lib.dir}/optional/openspaces"/>
<delete file="${lib.dir}/optional/openspaces/gs-openspaces-src.zip"/>
<zip zipfile="${lib.dir}/optional/openspaces/gs-openspaces-src.zip">
<fileset dir="${main.src.dir}">
<include name="org/openspaces/**"/>
</fileset>
</zip>
</target>
<!--
Generate javadoc for the main and JDK 1.5 sources.
-->
<target name="javadoc" description="Generate framework Javadocs" unless="env.minimal">
<echo message="${gs.product.version}" />
<delete dir="${target.javadoc.dir}" failonerror="false"/>
<mkdir dir="${target.javadoc.dir}"/>
<javadoc sourcepath="${main.src.dir}" destdir="${target.javadoc.dir}" windowtitle="GigaSpaces XAP ${gs.product.version} API"
source="1.6" access="protected" author="true" version="true" use="true"
useexternalfile="yes"
defaultexcludes="true"
header='<a href="index.html" target=\"_top\">GigaSpaces XAP ${gs.product.version} API</a>'
packagenames="org.openspaces.**.*"
excludepackagenames="org.openspaces.admin.internal.**.*, org.openspaces.core.executor.internal.**.*, org.openspaces.core.internal.**.*, org.openspaces.core.transaction.internal.**.*">
<arg value="-breakiterator"/>
<arg value="-J-Xmx256m"/>
<arg value="-J-XX:MaxPermSize=256m"/>
<doctitle><![CDATA[<h1>GigaSpaces XAP ${gs.product.version} API</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © <a href="http://www.gigaspaces.com/" target="_top">GigaSpaces</a>.</i>]]></bottom>
<classpath refid="all-libs"/>
<fileset dir="${basedir}/../${core.dir}/src/java" defaultexcludes="yes">
<include name="com/**"/>
<exclude name="com/j_spaces/jms/**" />
<exclude name="com/sun/jini/action/**" />
<exclude name="com/sun/jini/admin/**" />
<exclude name="com/sun/jini/collection/**" />
<exclude name="com/sun/jini/config/**" />
<exclude name="com/sun/jini/constants/**" />
<exclude name="com/sun/jini/discovery/**" />
<exclude name="com/sun/jini/discovery/internal/**" />
<exclude name="com/sun/jini/discovery/plaintext/**" />
<exclude name="com/sun/jini/landlord/**" />
<exclude name="com/sun/jini/loader/pref/internal/**" />
<exclude name="com/sun/jini/lookup/entry/**" />
<exclude name="com/sun/jini/mahalo/log/**" />
<exclude name="com/sun/jini/proxy/**" />
<exclude name="com/sun/jini/reggie/**" />
<exclude name="com/sun/jini/reliableLog/**" />
<exclude name="com/sun/jini/resource/**" />
<exclude name="com/sun/jini/start/**" />
<exclude name="com/sun/jini/system/**" />
<exclude name="com/sun/jini/thread/**" />
<exclude name="com/sun/jini/tool/**" />
<exclude name="com/sun/jini/tool/envcheck/**" />
<exclude name="com/sun/jini/tool/envcheck/plugins/**" />
<exclude name="net/jini/activation/**" />
<exclude name="net/jini/admin/**" />
<exclude name="net/jini/config/**" />
<exclude name="net/jini/constraint/**" />
<exclude name="net/jini/core/constraint/**" />
<exclude name="net/jini/core/discovery/**" />
<exclude name="net/jini/core/entry/**" />
<exclude name="net/jini/core/lookup/**" />
<exclude name="net/jini/discovery/**" />
<exclude name="net/jini/discovery/dynamic/**" />
<exclude name="net/jini/entry/**" />
<exclude name="net/jini/export/**" />
<exclude name="net/jini/id/**" />
<exclude name="net/jini/iiop/**" />
<exclude name="net/jini/io/**" />
<exclude name="net/jini/io/context/**" />
<exclude name="net/jini/loader/**" />
<exclude name="net/jini/loader/pref/**" />
<exclude name="net/jini/lookup/**" />
<exclude name="net/jini/lookup/entry/**" />
<exclude name="net/jini/security/**" />
<exclude name="net/jini/security/policy/**" />
<exclude name="net/jini/security/proxytrust/**" />
<exclude name="net/jini/url/file/**" />
<exclude name="net/jini/url/httpmd/**" />
<exclude name="net/jini/url/https/**" />
<contains text="JAVA-DOC-STAMP"/>
</fileset>
<fileset dir="${basedir}/../${core.dir}/src/java" defaultexcludes="yes">
<include name="com/sun/**/*.java"/>
<include name="net/**/*.java"/>
<exclude name="com/sun/jini/action/**" />
<exclude name="com/sun/jini/admin/**" />
<exclude name="com/sun/jini/collection/**" />
<exclude name="com/sun/jini/config/**" />
<exclude name="com/sun/jini/constants/**" />
<exclude name="com/sun/jini/discovery/**" />
<exclude name="com/sun/jini/discovery/internal/**" />
<exclude name="com/sun/jini/discovery/plaintext/**" />
<exclude name="com/sun/jini/landlord/**" />
<exclude name="com/sun/jini/loader/pref/internal/**" />
<exclude name="com/sun/jini/lookup/entry/**" />
<exclude name="com/sun/jini/mahalo/log/**" />
<exclude name="com/sun/jini/proxy/**" />
<exclude name="com/sun/jini/reggie/**" />
<exclude name="com/sun/jini/reliableLog/**" />
<exclude name="com/sun/jini/resource/**" />
<exclude name="com/sun/jini/start/**" />
<exclude name="com/sun/jini/system/**" />
<exclude name="com/sun/jini/thread/**" />
<exclude name="com/sun/jini/tool/**" />
<exclude name="com/sun/jini/tool/envcheck/**" />
<exclude name="com/sun/jini/tool/envcheck/plugins/**" />
<exclude name="net/jini/activation/**" />
<exclude name="net/jini/admin/**" />
<exclude name="net/jini/config/**" />
<exclude name="net/jini/constraint/**" />
<exclude name="net/jini/core/constraint/**" />
<exclude name="net/jini/core/discovery/**" />
<exclude name="net/jini/core/entry/**" />
<exclude name="net/jini/core/lookup/**" />
<exclude name="net/jini/discovery/**" />
<exclude name="net/jini/discovery/dynamic/**" />
<exclude name="net/jini/entry/**" />
<exclude name="net/jini/export/**" />
<exclude name="net/jini/id/**" />
<exclude name="net/jini/iiop/**" />
<exclude name="net/jini/io/**" />
<exclude name="net/jini/io/context/**" />
<exclude name="net/jini/loader/**" />
<exclude name="net/jini/loader/pref/**" />
<exclude name="net/jini/lookup/**" />
<exclude name="net/jini/lookup/entry/**" />
<exclude name="net/jini/security/**" />
<exclude name="net/jini/security/policy/**" />
<exclude name="net/jini/security/proxytrust/**" />
<exclude name="net/jini/url/file/**" />
<exclude name="net/jini/url/httpmd/**" />
<exclude name="net/jini/url/https/**" />
</fileset>
<!--fileset dir="${checkouts.dir}/openspaces-jetty/src/main/java" defaultexcludes="yes">
</fileset-->
<link href="http://download.oracle.com/javase/1,5.0/docs/api/"/>
<link href="http://www.gigaspaces.com/docs/JiniApi"/>
<link href="http://static.springsource.org/spring/docs/4.1.1.RELEASE/javadoc-api/"/>
<link href="http://aopalliance.sourceforge.net/doc"/>
<!-- Caucho Burlap/Hessian -->
<link href="http://jakarta.apache.org/commons/logging/apidocs/"/>
<link href="http://jakarta.apache.org/commons/pool/apidocs/"/>
</javadoc>
<zip zipfile="${target.dir}/xap-javadoc.zip">
<zipfileset dir="${target.javadoc.dir}">
<include name="**/*"/>
<exclude name="xap-javadoc.zip" />
</zipfileset>
</zip>
<delete dir="${target.javadoc.dir}" includes="**/*" excludes="xap-javadoc.zip" />
</target>
<target name="schema" description="Copy over schema files">
<delete dir="lib/optional/openspaces/schema"/>
<mkdir dir="lib/optional/openspaces/schema"/>
<copy todir="lib/optional/openspaces/schema" flatten="true">
<fileset dir="${main.resources.dir}">
<include name="**/*.xsd"/>
</fileset>
</copy>
</target>
<target name="license" description="Copy over license files">
<mkdir dir="lib/optional/openspaces"/>
<copy todir="lib/optional/openspaces" file="${basedir}/openspaces.license.txt"/>
<copy todir="lib/optional/openspaces" file="${basedir}/openspaces.notice.txt"/>
</target>
<target name="dist_1_5"
depends="build_1_5, javadoc, install.maven"
description="Creates the OpenSpaces distribution">
<exec executable="${env.M2_HOME}\bin\${mvn.executable}">
<arg line="assembly:single -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
</target>
<target name="install.maven" if="productversion">
<property name="maven.tmp.dir" value="${basedir}/maven.tmp.dir" />
<delete dir="${maven.tmp.dir}"/>
<java classname="org.openspaces.maven.support.POMGenerator" fork="true">
<arg value="${maven.tmp.dir}"/>
<classpath refid="all-libs"/>
<classpath location="${target.classes.dir}"/>
</java>
<echo message="${productversion}" />
<!-- Install newly created jar in local maven repository -->
<exec executable="${env.M2_HOME}\bin\${mvn.executable}">
<arg line="install:install-file -DgroupId=com.gigaspaces -DartifactId=gs-openspaces -DcreateChecksum=true -Dversion=${productversion} -Dpackaging=jar -DpomFile=${basedir}/pom.xml -Dfile=${target.dir}/gs-openspaces.jar -Djavadoc=${target.dir}/xap-javadoc.zip -Dsources=${target.dir}/gs-openspaces-sources.jar -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
<exec executable="${env.M2_HOME}\bin\${mvn.executable}">
<arg line="install:install-file -DgroupId=com.gigaspaces -DartifactId=gs-openspaces -DcreateChecksum=true -Dversion=${productversion} -Dpackaging=jar -DpomFile=${basedir}/pom.xml -Dfile=${target.dir}/gs-openspaces-${productversion}-tests.jar -Dclassifier=tests -Djavadoc=${target.dir}/xap-javadoc.zip -Dsources=${target.dir}/gs-openspaces-sources.jar -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
<replaceregexp file="${basedir}/tools/alert-integration/pom.xml"
match="<gsVersion>(.*)<\/gsVersion>"
replace="<gsVersion>${productversion}<\/gsVersion>"/>
<!--delete dir="${maven.tmp.dir}"/-->
</target>
<target name="dist">
<antcall target="dist_1_5"/>
</target>
<!--
########### TEST TARGETS ###########
-->
<!--
Compile the main test tree.
-->
<target name="buildmaintests" depends="build_1_5"
description="Compile test source tree java files into class files">
<mkdir dir="${target.testclasses.dir}"/>
<javac destdir="${target.testclasses.dir}" source="1.6" target="1.6" debug="${debug}"
deprecation="false" optimize="false" failonerror="true">
<src path="${main.test.dir}"/>
<classpath refid="all-libs"/>
<classpath location="${target.classes.dir}"/>
</javac>
<!-- Pick up config files from test directory -->
<copy todir="${target.testclasses.dir}" preservelastmodified="true">
<fileset dir="${main.test.dir}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
<target name="buildtests" depends="buildmaintests" description="Compile main test sources"/>
<target name="maintests" depends="buildtests" description="Run main tests">
<mkdir dir="${target.junit.reports.dir}"/>
<junit forkmode="${junit.forkmode}" printsummary="yes" haltonfailure="yes" haltonerror="yes">
<jvmarg line="-Djava.security.policy=policy/policy.all -Djava.awt.headless=true -Xmx512m -XX:MaxPermSize=128m"/>
<classpath location="${target.testclasses.dir}"/>
<classpath location="${target.classes.dir}"/>
<!-- Need files loaded as resources -->
<classpath location="${main.test.dir}"/>
<classpath location="${deploy.templates.dir}"/>
<classpath refid="tests-libs"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes" todir="${target.junit.reports.dir}">
<fileset dir="${target.testclasses.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
</batchtest>
</junit>
</target>
<target name="tests" depends="maintests" description="Run tests"/>
<!--
Run test suite and generate test summary.
Does not halt on failure or error.
-->
<target name="testsummary" description="Run tests and generate test summary">
<exec executable="${env.M2_HOME}\bin\${mvn.executable}">
<arg line="test -Dmaven.repo.local=${maven.repo.local}"/>
</exec>
</target>
<target name="create.dummy.file.if.tests.failed" if="junit.tests.failed">
<touch file="${target.junit.reports.dir}/failed" />
</target>
<target name="create.dummy.file.if.error.in.tests" if="junit.tests.error">
<touch file="${target.junit.reports.dir}/error" />
</target>
<target name="clean_tests" depends="clean,tests"/>
</project>