forked from JacORB/JacORB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
532 lines (461 loc) · 21.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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
<?xml version="1.0"?>
<project name="main" default="all" basedir=".">
<!-- ==================================================== -->
<!-- JacORB build file -->
<!-- $Id$ -->
<!-- ==================================================== -->
<property file="${basedir}/build.properties" />
<property environment="env" />
<property name="jvm-name" value="java"/>
<import file="etc/common.xml"/>
<!-- top-level target -->
<target name="all" depends="init,src-check,version-gen,compiler,omg_idl,jacorb,libs"
description="Build JacORB."/>
<target name="src-check">
<fail message="Unable to find src files. Is this a binary distribution?">
<condition>
<not>
<available file="${src}/org/jacorb/build.xml"/>
</not>
</condition>
</fail>
</target>
<target name="version-gen" >
<tstamp>
<format property="TIME" pattern="k:m:s"/>
</tstamp>
<loadfile srcFile="${src}/org/jacorb/util/Version.java" property="JVERSION">
<filterchain>
<containsregex pattern=".*version = "(.*)";"
replace="\1"/>
<striplinebreaks/>
</filterchain>
</loadfile>
<property name="BuildNo" value="${TODAY} ${TIME}" />
<property name="jacorb_version_info" value=" (Build ${BuildNo})" />
<echo>
using JacORB Version: ${JVERSION}
using BUILD_NUMBER: ${BuildNo}
</echo>
<copy file="${src}/org/jacorb/util/BuildVersion.template" tofile="${src.generated}/org/jacorb/util/BuildVersion.java" overwrite="true">
<filterset>
<filter token="VERSION_INFO" value="${jacorb_version_info}" />
</filterset>
</copy>
<!-- need to delete the classes that depend on the version number -->
<delete failonerror="false">
<fileset dir="${classdir}">
<include name="org/jacorb/orb/ORB.class" />
<include name="org/jacorb/idl/parser.class" />
<include name="org/jacorb/orb/giop/CodeSet.class" />
</fileset>
</delete>
</target>
<!-- ==================================================== -->
<!-- IDL compiler -->
<!-- ==================================================== -->
<target name="compiler" depends="init,version-gen,idlsrc,idllib"/>
<!-- package idl.jar -->
<target name="idllib" depends="idlsrc" >
<jar jarfile="${lib}/idl.jar"
basedir="${classdir}"
includes="org/jacorb/idl/**">
<manifest>
<attribute name="Implementation-Version" value="${JVERSION} ${jacorb_version_info}" />
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
</manifest>
</jar>
</target>
<target name="idlsrc">
<ant antfile="${src}/org/jacorb/idl/build.xml" dir="${basedir}" />
</target>
<!-- ==================================================== -->
<!-- OMG IDL files -->
<!-- ==================================================== -->
<target name="omg_idl" depends="compiler">
<ant antfile="${basedir}/idl/build.xml" dir="${basedir}"/>
</target>
<!-- ==================================================== -->
<!-- JacORB implementation -->
<!-- ==================================================== -->
<target name="jacorb" depends="init">
<ant antfile="${src}/org/jacorb/build.xml" dir="${basedir}"/>
</target>
<!-- ==================================================== -->
<!-- Libraries -->
<!-- ==================================================== -->
<target name="libs" depends="init,jar,scripts"/>
<target name="jar" depends="init">
<delete file="${lib}/jacorb.jar" failonerror="false"/>
<delete file="${lib}/jacorb-services.jar" failonerror="false"/>
<jar jarfile="${lib}/jacorb.jar"
index="true"
basedir="${classdir}"
includes="org/jacorb/**,org/omg/**"
excludes="org/jacorb/idl/**,
org/jacorb/demo/**,
org/jacorb/test/**,
org/jacorb/concurrency/**,
org/jacorb/collection/**,
org/jacorb/dds/**,
org/jacorb/events/**,
org/jacorb/notification/**,
org/jacorb/transaction/**,
org/omg/BridgeTransactionMgmt/**,
org/omg/CosBridgeAdmin/**,
org/omg/CosCollection/**,
org/omg/CosConcurrencyControl/**,
org/omg/CosEventChannelAdmin/**,
org/omg/CosEventComm/**,
org/omg/CosNotification/**,
org/omg/CosNotifyChannelAdmin/**,
org/omg/CosNotifyChannelAdminAck/**,
org/omg/CosNotifyComm/**,
org/omg/CosNotifyCommAck/**,
org/omg/CosNotifyFilter/**,
org/omg/CosTime/**,
org/omg/CosTrading/**,
org/omg/CosTransactions/**,
org/omg/CosTypedEventChannelAdmin/**,
org/omg/CosTypedEventComm/**,
org/omg/CosTypedEventNotifyChannelAdmin/**,
org/omg/CosTypedNotifyChannelAdmin/**,
org/omg/CosTypedNotifyComm/**,
org/omg/CosTypedEventNotifyComm/**,
org/omg/dds/**
">
<manifest>
<attribute name="Implementation-Version" value="${JVERSION} ${jacorb_version_info}" />
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
<attribute name="Class-Path" value="slf4j-api-1.6.4.jar slf4j-jdk14-1.6.4.jar"/>
</manifest>
</jar>
<jar jarfile="${lib}/jacorb-services.jar"
index="true"
basedir="${classdir}"
includes="org/jacorb/concurrency/**,
org/jacorb/collection/**,
org/jacorb/dds/**,
org/jacorb/events/**,
org/jacorb/notification/**,
org/jacorb/transaction/**,
org/omg/BridgeTransactionMgmt/**,
org/omg/CosBridgeAdmin/**,
org/omg/CosCollection/**,
org/omg/CosConcurrencyControl/**,
org/omg/CosEventChannelAdmin/**,
org/omg/CosEventComm/**,
org/omg/CosNotification/**,
org/omg/CosNotifyChannelAdmin/**,
org/omg/CosNotifyChannelAdminAck/**,
org/omg/CosNotifyComm/**,
org/omg/CosNotifyCommAck/**,
org/omg/CosNotifyFilter/**,
org/omg/CosTime/**,
org/omg/CosTrading/**,
org/omg/CosTransactions/**,
org/omg/CosTypedEventChannelAdmin/**,
org/omg/CosTypedEventComm/**,
org/omg/CosTypedEventNotifyComm/**,
org/omg/CosTypedEventNotifyChannelAdmin/**,
org/omg/CosTypedNotifyChannelAdmin/**,
org/omg/CosTypedNotifyComm/**,
org/omg/dds/**
">
<manifest>
<attribute name="Implementation-Version" value="${JVERSION} ${jacorb_version_info}" />
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
<attribute name="Class-Path" value="antlr-2.7.2.jar picocontainer-1.2.jar jacorb.jar"/>
</manifest>
</jar>
<jar jarfile="${lib}/jacorb-sources.jar">
<fileset dir="${src}/generated"/>
<fileset dir="${src}" excludes="generated/**,java_mapping/**,omg-03-01-02/**"/>
<manifest>
<attribute name="Implementation-Version" value="${JVERSION} ${jacorb_version_info}" />
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
</manifest>
</jar>
</target>
<!-- This target will split the JacORB jar into jacorb.jar containing JUST the implementation -->
<!-- code and omg.jar containing the generated stubs -->
<target name="jar_impl_omg" depends="init">
<delete file="${lib}/jacorb.jar" failonerror="false"/>
<delete file="${lib}/omg.jar" failonerror="false"/>
<jar jarfile="${lib}/jacorb.jar"
basedir="${classdir}"
includes="org/jacorb/**"
excludes="org/jacorb/idl/**,
org/jacorb/demo/**,
org/jacorb/test/**,
org/jacorb/concurrency/**,
org/jacorb/collection/**,
org/jacorb/dds/**,
org/jacorb/events/**,
org/jacorb/notification/**,
org/jacorb/transaction/**,
">
<manifest>
<attribute name="Implementation-Version" value="${JVERSION} ${jacorb_version_info}" />
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
<attribute name="Class-Path" value="slf4j-api-1.6.4.jar slf4j-jdk14-1.6.4.jar"/>
</manifest>
</jar>
<jar jarfile="${lib}/omg.jar"
basedir="${classdir}"
includes="org/omg/**"
excludes="org/omg/BridgeTransactionMgmt/**,
org/omg/CosBridgeAdmin/**,
org/omg/CosCollection/**,
org/omg/CosConcurrencyControl/**,
org/omg/CosEventChannelAdmin/**,
org/omg/CosEventComm/**,
org/omg/CosNotification/**,
org/omg/CosNotifyChannelAdmin/**,
org/omg/CosNotifyChannelAdminAck/**,
org/omg/CosNotifyComm/**,
org/omg/CosNotifyCommAck/**,
org/omg/CosNotifyFilter/**,
org/omg/CosTime/**,
org/omg/CosTrading/**,
org/omg/CosTransactions/**,
org/omg/CosTypedEventChannelAdmin/**,
org/omg/CosTypedEventComm/**,
org/omg/CosTypedEventNotifyChannelAdmin/**,
org/omg/CosTypedEventNotifyComm/**,
org/omg/dds/**
">
<manifest>
<attribute name="Implementation-Version" value="${JVERSION} ${jacorb_version_info}" />
<attribute name="Implementation-Title" value="JacORB"/>
<attribute name="Implementation-URL" value="www.jacorb.org"/>
</manifest>
</jar>
</target>
<target name="scripts" depends="init" description="Generate the scripts">
<macrodef name="jacorb-loadfile">
<attribute name="srcFile" />
<attribute name="property" />
<sequential>
<loadfile srcFile="@{srcFile}"
property="@{property}"
failonerror="true" />
</sequential>
</macrodef>
<jacorb-loadfile
srcFile="bin/resolve_jacorb_home.tok"
property="token.resolve-jacorb-home" />
<jacorb-loadfile
srcFile="bin/resolve_java_cmd.tok"
property="token.resolve-java-cmd" />
<jacorb-loadfile
srcFile="bin/resolve_jaco_cmd.tok"
property="token.resolve-jaco-cmd" />
<copy todir="bin" overwrite="true">
<fileset dir="bin">
<include name="*.tpl"/>
</fileset>
<globmapper from="*.tpl" to="*"/>
<filterset>
<filter token="JACORB_BOOTCLASSPATH"
value="-Djava.endorsed.dirs="${JACORB_HOME}/lib"" />
<filter token="RESOLVE_JACORB_HOME"
value="${token.resolve-jacorb-home}" />
<filter token="RESOLVE_JAVA_CMD"
value="${token.resolve-java-cmd}" />
<filter token="RESOLVE_JACO_CMD"
value="${token.resolve-jaco-cmd}" />
<filter token="JAVA_CMD" value="${jvm-name}" />
<filter token="JACORB_HOME"
value="${basedir}" />
<filter token="DONT_EDIT"
value="don't edit this file. edit the template instead" />
</filterset>
</copy>
<condition property="eol" value="crlf">
<or>
<os family="windows"/>
<os family="dos"/>
</or>
</condition>
<!-- shell scripts should always be set to LF -->
<property name="eol" value="lf" />
<fixcrlf srcDir="bin"
includes="*"
excludes="*.exe,*.conf,*template*"
eol="${eol}" />
<chmod perm="ugo+rx">
<fileset dir="bin">
<include name="*" />
<exclude name="*.bat" />
<exclude name="*.exe" />
<exclude name="*.conf" />
<exclude name="*template*" />
</fileset>
</chmod>
</target>
<!-- ==================================================== -->
<!-- clean up -->
<!-- ==================================================== -->
<target name="clean" depends="init" description="Clean the checkout">
<delete file="${basedir}/bin/idl"/>
<delete file="${basedir}/bin/idl.bat"/>
<delete file="${basedir}/bin/jaco"/>
<delete file="${basedir}/bin/jaco.bat"/>
<delete file="${basedir}/bin/ntfy-wrapper" />
<delete file="${basedir}/bin/ns-wrapper" />
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${classdir}" includes="**/*" />
</delete>
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${src.generated}" includes="**/*" />
</delete>
<delete failonerror="false" >
<fileset dir="${basedir}/src/org/jacorb/idl" >
<include name="**/parser.java"/>
<include name="**/sym.java"/>
</fileset>
</delete>
</target>
<target name="realclean" depends="clean" description="Clean the checkout including generated jars">
<delete failonerror="false" >
<fileset dir="lib/" includes="jacorb.jar, idl.jar, jacorb-sources.jar, jacorb-services.jar"/>
</delete >
</target>
<!-- ==================================================== -->
<!-- API documentation -->
<!-- ==================================================== -->
<target name="doc" depends="init" description="Create the Javadoc">
<property name="PKGNAMES" value="org.jacorb.idl.*,org.jacorb.util.*,org.jacorb.orb.*,org.jacorb.imr.*,org.jacorb.ir.*,org.jacorb.poa.*,org.jacorb.events.*,org.jacorb.naming.*,org.jacorb.security.sas.*,org.omg.*,org.jacorb.notification.*" />
<property name="PKGNAMES_EXCLUDED" value="org.jacorb.notification.filter.bsh" />
<property name="SRCDIR2" value="" />
<!-- ignore xdoclet tags -->
<property name="IGNORED_TAGS" value="-tag jmx.mbean:X -tag jboss.xmbean:X -tag jmx.managed-attribute:X -tag jmx.managed-operation:X" />
<mkdir dir="${basedir}/doc/api"/>
<javadoc destdir="${basedir}/doc/api"
additionalparam="${IGNORED_TAGS}"
classpathref="path.base"
Splitindex="Yes"
Use="Yes"
maxmemory="256m"
packagenames="${PKGNAMES}"
excludepackagenames="${PKGNAMES_EXCLUDED}">
<sourcepath>
<path refid="sourcepath.base" />
<path path="${SRCDIR2}" />
</sourcepath>
</javadoc>
</target>
<!-- ==================================================== -->
<!-- PMD -->
<!-- ==================================================== -->
<target name="pmd-locate" if="env.PMD_HOME" >
<property name="pmd.home" value="${env.PMD_HOME}" />
</target>
<target name="pmd-path1" depends="pmd-locate" if="pmd.home">
<path id="pmd.path" >
<fileset dir="${pmd.home}/lib" >
<include name="*.jar" />
</fileset>
</path>
</target>
<target name="pmd-path2" depends="pmd-path1" unless="pmd.home">
<path id="pmd.path" >
<pathelement path="${java.class.path}"/>
</path>
</target>
<target name="pmd-check" depends="pmd-path2" >
<available classname="net.sourceforge.pmd.ant.PMDTask" property="pmd.isavailable" classpathref="pmd.path"/>
<fail unless="pmd.isavailable" >
error
unable to locate PMD (http://pmd.sourceforge.net).
either set the environment variable PMD_HOME,
set the ant property pmd.home or add the PMD
classes to your CLASSPATH.
</fail>
<pathconvert property="_pmd.cp" refid="pmd.path" />
<echo level="verbose">pmd is using classpath: ${_pmd.cp}</echo>
</target>
<target name="pmd-taskdef" depends="init, pmd-check">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.path"/>
</target>
<target name="pmd" depends="init, pmd-taskdef">
<echo message="this might take some time..." />
<pmd rulesetfiles="${basedir}/etc/pmd-ruleset.xml" shortFilenames="true">
<formatter type="summaryhtml" toFile="pmd_report.html"/>
<fileset dir="${src}/org/jacorb">
<!-- So much is generated code is there much point? -->
<!-- <include name="idl/**/*.java"/> -->
<include name="imr/**/*.java"/>
<include name="orb/**/*.java"/>
<include name="poa/**/*.java"/>
<include name="security/**/*.java"/>
<include name="util/**/*.java"/>
<!-- Exclude tracing as very old unsupported code -->
<exclude name="util/tracing/*.java"/>
</fileset>
</pmd>
</target>
<!-- ==================================================== -->
<!-- FINDBUGS -->
<!-- ==================================================== -->
<target name="findbugs-locate" if="env.FINDBUGS_HOME">
<property name="findbugs.home" value="${env.FINDBUGS_HOME}" />
</target>
<target name="findbugs-path1" depends="findbugs-locate" if="findbugs.home" >
<path id="findbugs.path">
<fileset dir="${findbugs.home}/lib" >
<include name="*.jar" />
</fileset>
</path>
</target>
<target name="findbugs-path2" depends="findbugs-path1" unless="findbugs.home">
<echo message="findbugs-path2" />
<path id="findbugs.path" >
<pathelement path="${java.class.path}"/>
</path>
</target>
<target name="findbugs-check" depends="findbugs-path2">
<available classname="edu.umd.cs.findbugs.anttask.FindBugsTask" property="findbugs.isavailable" classpathref="findbugs.path"/>
<fail unless="findbugs.isavailable" >
error
unable to locate FindBugs (http://findbugs.sourceforge.net/).
either set the environment variable FINDBUGS_HOME,
set the ant property findbugs.home or add the FindBugs
classes to your CLASSPATH.
</fail>
<pathconvert property="_findbugs.cp" refid="findbugs.path" />
<echo level="verbose">findbugs is using classpath: ${_findbugs.cp}</echo>
</target>
<target name="findbugs-taskdef" depends="init, findbugs-check">
<pathconvert property="_findbugs.cp" refid="findbugs.path" />
<echo level="verbose">findbugs is using classpath: ${_findbugs.cp}</echo>
<taskdef name="findBugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs.path"/>
</target>
<target name="findbugs" depends="findbugs-taskdef">
<echo message="this might take some time..." />
<findBugs home="${findbugs.home}"
output="html"
outputFile="${basedir}/findbugs_report.html"
excludeFilter="${basedir}/etc/findbugs-ruleset.xml"
reportLevel="medium"
effort="default"
jvmargs="-Xmx500M"
timeout="12000000">
<sourcePath path="${src}"/>
<auxClasspath path="${classdir}"/>
<auxClasspath path="${basedir}/lib/slf4j-api-1.6.4.jar"/>
<systemProperty name="findbugs.de.comment" value="true"/>
<class location="${basedir}/classes/org/jacorb/imr"/>
<class location="${basedir}/classes/org/jacorb/orb"/>
<class location="${basedir}/classes/org/jacorb/poa"/>
<class location="${basedir}/classes/org/jacorb/security"/>
<class location="${basedir}/classes/org/jacorb/util"/>
</findBugs>
</target>
</project>