forked from iLCSoft/LCIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
808 lines (695 loc) · 35.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
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- Generic ANT build file -->
<!-- this file is used for FreeHEP and WIRED -->
<!-- -->
<!-- Author: Mark Donszelmann -->
<!-- Version: $Id: build.xml,v 1.24 2007-09-26 20:45:41 jeremy Exp $ -->
<!-- -->
<!-- ======================================================================= -->
<project name="Generic-Build" default="all" basedir=".">
<!-- Load properties in reverse order, since they cannot be overridden. -->
<!-- Order is: command-line, ant, user, jarfile, system -->
<!-- Ant properties -->
<property file="config/ant.properties" />
<!-- User properties -->
<property file="${user.home}/${projectname}.properties" />
<!-- JarFile properties in subdir -->
<property file="${jar}/${projectname}-${jar}.properties" />
<!-- JarFile properties -->
<property file="config/${projectname}-${jar}.properties" />
<!-- System properties -->
<property file="config/${projectname}.properties" />
<property name="dist.dir" value="dist"/>
<property name="docs.dir" value="doc"/>
<!-- ====== here we can exclude certain packages from the build if we are using JDK 1.4 ===== -->
<target name="jdk14excludes" depends="checkjdk" if="isjdk14">
<property name="packages.exclude" value="hep.lcio.util"/>
<property name="javadoc.packages.excludes" value="${packages.exclude}"/>
<echo message="********************************************************"/>
<echo message="* Using JDK 1.4 - skipping: ${packages.exclude} " />
<echo message="********************************************************"/>
</target>
<target name="jdk15excludes" depends="checkjdk" unless="isjdk14">
<property name="packages.exclude" value=""/>
<property name="javadoc.packages.excludes" value="${packages.exclude}"/>
<echo message="********************************************************"/>
<echo message="* Using JDK 1.5 - skipping: ${packages.exclude} " />
<echo message="********************************************************"/>
</target>
<target name="checkjdk">
<condition property="isjdk14">
<equals arg1="${ant.java.version}" arg2="1.4"/>
</condition>
</target>
<!-- =================================================================== -->
<!-- Help -->
<!-- =================================================================== -->
<target name="help" description="< target> display help on how to define specific targets">
<echo message="ANT builder for ${projectname}"/>
<echo message=""/>
<echo message=" Usage:"/>
<echo message=" ant -Djar=jarsuffix jar-target works on ${projectname}-jarsuffix"/>
<echo message=" where jarsuffix is one of: ${jars}"/>
<echo message=" or"/>
<echo message=" ant gen-target works globally"/>
<echo message=""/>
<echo message=" or"/>
<echo message=" ant -projecthelp shows all targets, gen-targets and jar-targets"/>
</target>
<!-- =================================================================== -->
<!-- Initialization, setup of commands, check -->
<!-- =================================================================== -->
<target name="init" depends="jdk14excludes,jdk15excludes">
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
<taskdef name="freehep.ant" classname="org.freehep.ant.FreeHepAnt"/>
<taskdef name="freehep.defined" classname="org.freehep.ant.FreeHepDefined"/>
<taskdef name="freehep.not.defined" classname="org.freehep.ant.FreeHepNotDefined"/>
<taskdef name="freehep.delete" classname="org.freehep.ant.FreeHepDelete"/>
<taskdef name="freehep.exec" classname="org.freehep.ant.FreeHepExec"/>
<taskdef name="freehep.jar" classname="org.freehep.ant.FreeHepJar"/>
<taskdef name="freehep.javac" classname="org.freehep.ant.FreeHepJavac"/>
<taskdef name="freehep.javacc" classname="org.freehep.ant.FreeHepJavaCC"/>
<taskdef name="freehep.javadoc" classname="org.freehep.ant.FreeHepJavadoc"/>
<taskdef name="freehep.javah" classname="org.freehep.ant.FreeHepJavah"/>
<taskdef name="freehep.jlink" classname="org.freehep.ant.FreeHepJlink"/>
<taskdef name="freehep.signjar" classname="org.freehep.ant.FreeHepSignJar"/>
<tstamp />
<!-- Check for property "projectname" -->
<freehep.not.defined property="projectname" message="Property 'projectname' must be defined at the top of the 'build.xml' file"/>
<!-- Check for file "config/${projectname}.properties" -->
<available file="config/${projectname}.properties" property="project.properties"/>
<freehep.not.defined property="project.properties" message="Cannot find project property file: 'config/${projectname}.properties'"/>
<!-- Copy version file -->
<filter token="WARNING" value="This file is generated, version number is in config/${projectname}.properties" />
<filter token="TITLE" value="${title}" />
<filter token="VERSION" value="${dist.version}" />
<filter token="DATE" value="${TODAY}" />
<filter token="TIME" value="${TSTAMP}" />
<copy overwrite="yes" filtering="on"
file="config/version.template"
tofile="${jar.dir}/${projectname}-version.txt"
/>
<condition property="isJDK1.4">
<equals arg1="${ant.java.version}" arg2="1.4"/>
</condition>
</target>
<target name="init.jar" depends="init">
<!-- Check for "jar" to be defined -->
<freehep.not.defined property="jar" message="Target only available with '-Djar=suffix' option"/>
<!-- Check for file "${projectname}-jar.properties" -->
<available file="${jar}/${projectname}-${jar}.properties" property="jar.properties"/>
<available file="config/${projectname}-${jar}.properties" property="jar.properties"/>
<freehep.defined property="jar.properties" target="init.jar.ok"/>
<freehep.not.defined property="jar.properties" target="init.jar.failed"/>
</target>
<target name="init.jar.failed">
<echo message=" Skipping module '${projectname}-${jar}'"/>
</target>
<target name="init.jar.ok">
<!-- Check for property "title" -->
<freehep.not.defined property="title" message="Property 'title' must be defined in 'config/${projectname}-${jar}.properties'. Examples 'title=${projectname} Plugin'"/>
<!-- Check for property "name" -->
<freehep.not.defined property="name" message="Property 'name' must be defined in 'config/${projectname}-${jar}.properties'. Examples 'name=tools'"/>
<!-- Check for property "packages" -->
<freehep.not.defined property="packages" message="Property 'packages' must be defined in 'config/${projectname}-${jar}.properties'. Examples 'packages=hep.wired.dim.*, hep.atlas.wired.*'"/>
</target>
<!-- =================================================================== -->
<!-- Generates java from jj -->
<!-- =================================================================== -->
<target name="jj" depends="jj.generate, all" description="<jar-target> compiles jj files using javacc">
</target>
<target name="jj.generate" depends="init.jar">
<freehep.javacc includes="${javacc.includes}" javacchome="${javacc.home}"/>
</target>
<!-- =================================================================== -->
<!-- Generates documentation using -->
<!-- javadoc, doxygen, pdflatex, latex, latex2html -->
<!-- =================================================================== -->
<target name="doc.all" depends="doc,doc.manual,doc.ref" description="creates all documentation ">
</target>
<!-- =================================================================== -->
<!-- Generates the users manual (ps and pdf and html) from latex source -->
<!-- =================================================================== -->
<target name="doc.manual">
<exec dir="./src/latex/manual" executable="latex" os="Linux" failOnError="true">
<arg line=" manual.tex"/>
</exec>
<exec dir="./src/latex/manual" executable="latex" os="Linux" failOnError="true">
<arg line=" manual.tex"/>
</exec>
<exec dir="./src/latex/manual" executable="dvips" os="Linux" failOnError="true">
<arg line=" manual.dvi"/>
</exec>
<exec dir="./src/latex/manual" executable="cp" os="Linux" failOnError="true">
<arg line=" manual.ps ../../../doc/"/>
</exec>
<exec dir="./src/latex/manual" executable="pdflatex" os="Linux" failOnError="true">
<arg line=" manual.tex"/>
</exec>
<exec dir="./src/latex/manual" executable="cp" os="Linux" failOnError="true">
<arg line=" manual.pdf ../../../doc/"/>
</exec>
<exec dir="./src/latex/manual" executable="latex2html" os="Linux" failOnError="true">
<arg line=" -mkdir -dir ../../../doc/manual_html -info 0 -no_auto_link -split 0 -no_navigation manual.tex"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Generates the reference manual -->
<!-- =================================================================== -->
<target name="doc.ref">
<exec dir="./doc/doxygen_api/latex" executable="latex" os="Linux">
<arg line=" refman.tex"/>
</exec>
<exec dir="./doc/doxygen_api/latex" executable="latex" os="Linux">
<arg line=" refman.tex"/>
</exec>
<exec dir="./doc/doxygen_api/latex" executable="dvips" os="Linux">
<arg line=" refman.dvi"/>
</exec>
<exec dir="./doc/doxygen_api/latex" executable="psnup" os="Linux">
<arg line=" -2 refman.ps ../../lciorefman.ps"/>
</exec>
<exec dir="./doc/doxygen_api/latex" executable="rm" os="Linux">
<arg line=" refman.ps"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Generates java and hh from aid -->
<!-- =================================================================== -->
<target name="aid" depends="aid.generate, all" description="<jar-target> compiles aid files using aid">
</target>
<target name="aid.generate" depends="init">
<java classpath="${aid.classpath}" classname="${aid.class}">
<arg line="-directory ${aid.java.dir} -property config JavaInterfaceGenerator ${aid.includes} ${aid.java.includes} ${aid.java.interface.includes}"/>
</java>
<java classpath="${aid.classpath}" classname="${aid.class}">
<arg line="-directory ${aid.java.dir} -property config JavaClassGenerator ${aid.java.classes}"/>
</java>
<!--java classpath="${aid.classpath}" classname="${aid.class}">
<arg line="-directory ${aid.cpp.dir} -property config CPPHeaderGenerator ${aid.includes} ${aid.cpp.includes}"/>
</java-->
<java classpath="${aid.classpath}" classname="${aid.class}">
<arg line="-directory ${aid.jni.dir} -property config JNIHeaderGenerator ${aid.jni.includes}"/>
</java>
<java classpath="${aid.classpath}" classname="${aid.class}">
<arg line="-directory ${aid.jni.dir} -property config JNICodeGenerator ${aid.jni.includes}"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Generates java from IDL -->
<!-- =================================================================== -->
<target name="idl" depends="idl.generate, all" description="<jar-target> compiles idl files using jidl">
</target>
<target name="idl.generate" depends="init.jar">
<echo message=" Creating idl from file running command(s):"/>
<echo message=" '${jidl}'"/>
<freehep.exec command="${jidl}"
dir="${src.dir}"
/>
</target>
<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="init.jar" description="<jar-target> compiles java files">
<freehep.defined property="src.dir" target="compile.ok"/>
</target>
<target name="compile.ok" >
<echo message=" Building module '${projectname}-${jar}'"/>
<freehep.javac srcdir="${src.dir}"
destdir="${src.dir}"
classpath="${exp.classpath};${classpath}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimization}"
packages="${packages}"
excludepackages="${packages.exclude}"
includes="${compile.includes}"
excludes="${compile.excludes}">
</freehep.javac>
</target>
<!-- =================================================================== -->
<!-- Creates the rmi stubs and skeletons -->
<!-- =================================================================== -->
<target name="rmi" depends="compile" description="<jar-target> compiles class files using rmic">
<freehep.defined property="src.dir" target="rmi.ok"/>
</target>
<target name="rmi.ok">
<rmic base="${src.dir}"
includes="${rmi.includes}"
excludes="${rmi.excludes}"
/>
</target>
<!-- =================================================================== -->
<!-- Creates the jni header files -->
<!-- =================================================================== -->
<target name="jni" depends="rmi" description="<jar-target> compiles class files using javah">
<freehep.defined property="src.dir" target="jni.ok"/>
</target>
<target name="jni.ok">
<freehep.javah base="${src.dir}"
includes="${jni.includes}"
excludes="${jni.excludes}"
/>
</target>
<!-- =================================================================== -->
<!-- Creates the jar archive -->
<!-- =================================================================== -->
<target name="jar" depends="jni" description="<jar-target> creates jar file">
<freehep.defined property="src.dir" target="jar.ok"/>
</target>
<target name="jar.ok">
<freehep.jar jarfile="${jar.dir}/${name}.jar"
basedir="${src.dir}"
packages="${packages}"
excludepackages="${packages.exclude}"
extensions="${jar.suffixes}"
includes="${jar.inf}"
excludes="${jar.excludes}"
>
<fileset dir="."
includes="${jar.includes}"
/>
</freehep.jar>
</target>
<!-- =================================================================== -->
<!-- Creates the war archive -->
<!-- =================================================================== -->
<target name="war" depends="init" description="<jar-target> creates war file">
<freehep.defined property="jar" target="war.ok"/>
<freehep.not.defined property="jar" target="war.all"/>
</target>
<target name="war.ok" depends="init.jar">
<war warfile="${war.dir}/${name}.war"
webxml="${war.webxml}"
basedir="${src.dir}"
includes="${war.includes}"
>
<fileset dir="${war.docdir}" includes="${war.docfiles}"/>
<lib dir="lib" includes="${packages}"/>
</war>
</target>
<target name="war.all" depends="all">
<echo message=" Building all wars"/>
<freehep.ant jars="${wars}" args="war"/>
</target>
<target name="war.clean" depends="init.jar" description="<jar-target> cleans up war file">
<freehep.delete file="${war.dir}/${name}.jar"/>
</target>
<!-- =================================================================== -->
<!-- Creates the JLinked archive -->
<!-- =================================================================== -->
<target name="jlink" depends="init" description="<jar-target> creates jlinked jar file">
<freehep.defined property="jar" target="jlink.ok"/>
<freehep.not.defined property="jar" target="jlink.all"/>
</target>
<target name="jlink.ok" depends="init.jar">
<!-- Copy manifest file -->
<filter token="WARNING" value="This file is generated, version number is in config/${projectname}.properties" />
<filter token="NAME" value="${mainpackage}" />
<filter token="TITLE" value="${title}" />
<filter token="VERSION" value="${dist.version}" />
<filter token="VENDOR" value="${copyright}" />
<filter token="DATETIME" value="${TODAY} - ${TSTAMP}" />
<freehep.delete file="${jlink.dir}/META-INF/MANIFEST.MF"/>
<copy overwrite="yes" filtering="on"
file="config/manifest.template"
tofile="${jlink.dir}/META-INF/MANIFEST.MF"
/>
<!-- FIXME: jlink seems to deliver wrong files (not unjarrable) when compress is true -->
<freehep.jlink compress="true"
outfile="${jlink.dir}/${name}.jar"
srcdir="${jlink.src.dir}"
mergefiles="${packages}">
<addfiles>
<pathelement location="${jlink.dir}/META-INF"/>
</addfiles>
</freehep.jlink>
</target>
<target name="jlink.all" depends="all">
<echo message=" Building all jlinked jars"/>
<freehep.ant jars="${jlinks}" args="jlink"/>
</target>
<target name="jlink.clean" depends="init.jar" description="<jar-target> cleans up jlinked jar file">
<freehep.delete file="${jlink.dir}/${name}.jar"/>
</target>
<!-- =================================================================== -->
<!-- Default target -->
<!-- =================================================================== -->
<target name="all" depends="init" description="< default> builds: compile, rmi, jni and jar">
<freehep.defined property="jar" target="all.jar"/>
<freehep.not.defined property="jar" target="all.all"/>
</target>
<target name="all.jar" depends="init.jar, jar">
</target>
<target name="all.all">
<echo message=" Building all modules"/>
<freehep.ant jars="${jars}"/>
</target>
<!-- =================================================================== -->
<!-- Signs Jar files -->
<!-- =================================================================== -->
<target name="sign" depends="all" description="<gen-target> signs jar files (needs password)">
<freehep.defined property="jar" message="Target 'sign' only available without '-Djar=suffix' option"/>
<freehep.not.defined property="password" message="Target 'sign' only available with '-Dpassword=password' option"/>
<freehep.not.defined property="jar.signed.dir" message="Internal error: jar.signed.dir is not defined!"/>
<freehep.not.defined property="keystore" message="Internal error: keystore is not defined!"/>
<freehep.not.defined property="keystore.alias" message="Internal error: keystore.alias is not defined!"/>
<mkdir dir="${jar.signed.dir}"/>
<freehep.signjar
srcdir="${jar.dir}"
jars="${jar.signed.jars}"
dstdir="${jar.signed.dir}"
alias="${keystore.alias}"
keystore="${keystore}"
storepass="${password}"/>
</target>
<!-- =================================================================== -->
<!-- Copies FreeHEP Libs (Only used for packages that use freehep -->
<!-- =================================================================== -->
<target name="copyfreehep" depends="init" description="<gen-target> copies FreeHEP libs">
<freehep.defined property="jar" message="Target 'copyfreehep' only available without '-Djar=suffix' option"/>
<freehep.not.defined property="freehep" message="Target 'copyfreehep' only available with '-Dfreehep=FreeHepHomeDir' option"/>
<copy todir="lib">
<fileset dir="${freehep}/lib"
includes="freehep-2d.jar, freehep-3d.jar, freehep-base.jar, freehep-hep3d.jar, freehep-heprep.jar, freehep-j3d.jar, xerces.jar"
/>
</copy>
<copy todir="tools">
<fileset dir="${freehep}/lib"
includes="freehep-tools.jar"
/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Runs the tests and creates the reports -->
<!-- THIS SEEMS TO RUN TESTCASES ONLY AND NO SUITES, presumably because -->
<!-- of output gathering. Still needs some rethinking -->
<!-- =================================================================== -->
<target name="test" depends="init" description="<gen-target> runs tests and creates reports">
<junit printsummary="yes" fork="no">
<classpath>
<pathelement path="." />
<pathelement path="${test.classpath}" />
</classpath>
<formatter type="plain" />
<test name="hep.lcio.test.RandomEventTest" />
<!--<test name="org.freehep.graphicsio.test.TestSuite" />-->
</junit>
<junitreport todir="${test.output}">
<fileset dir="${test.output}">
<include name="TEST-*.xml"/>
</fileset>
<report format="${test.format}" todir="${test.html}"/>
</junitreport>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation for user / system -->
<!-- =================================================================== -->
<target name="doc" depends="init" description="<gen-target> creates apidoc using javadoc">
<freehep.defined property="jar" message="Target 'doc' only available without '-Djar=suffix' option"/>
<freehep.not.defined property="doc.dst" message="Target 'doc' only available with '-Dweb.dst=destination' option"/>
<!-- To be replaced by sysdoc if we get to jdk 1.4 only -->
<mkdir dir="${doc.dst}"/>
<freehep.javadoc packagenames="${javadoc.packages}"
sourcepath="${exp.srcpath};${srcpath}"
excludepackagenames="${javadoc.packages.excludes}"
classpath="${exp.classpath};${classpath}"
destdir="${doc.dst}"
overview="overview.html"
author="true"
version="true"
windowtitle="${javadoc.windowtitle}, Version ${dist.version}"
doctitle="${javadoc.doctitle}<br>Version ${dist.version}"
link="${javadoc.extdocs}"
header="<B>${javadoc.header}<br>Version ${dist.version}</B>"
footer="<B>${javadoc.footer}<br>Version ${dist.version}</B>"
bottom="${copyright}"
maxmemory="${javadoc.maxmemory}">
</freehep.javadoc>
</target>
<target name="sysdoc" depends="init" description="<gen-target> creates apidoc using FreeHEP doclet">
<freehep.defined property="jar" message="Target 'sysdoc' only available without '-Djar=suffix' option"/>
<freehep.not.defined property="doc.dst" message="Target 'sysdoc' only available with '-Dweb.dst=destination' option"/>
<mkdir dir="${doc.dst}"/>
<java classpath="${buildtools.jar}" classname="${buildtools.generatestatus}" output="${doc.dst}/status.log">
<arg line="${doc.dst}/status.xml ${projectname} ${dist.version} ${buildtools.generatestatus.packages}"/>
</java>
<java classpath="${buildtools.jar}" classname="${buildtools.transformstatus}" output="${doc.dst}/status.log">
<arg line="${doc.dst}/status.xml ${doc.dst}/status.html"/>
</java>
<freehep.javadoc packagenames="${javadoc.packages}"
additionalparam="-breakiterator"
overview="overview.html"
excludepackagenames="${javadoc.packages.excludes}"
sourcepath="${exp.srcpath};${srcpath}"
classpath="${exp.classpath};${classpath}"
destdir="${doc.dst}"
author="true"
version="true"
windowtitle="${javadoc.windowtitle}, Version ${dist.version}"
doctitle="${javadoc.doctitle}<br>Version ${dist.version}"
link="${javadoc.extdocs}"
header="<B>${javadoc.header}<br>Version ${dist.version}</B>"
footer="<B>${javadoc.footer}<br>Version ${dist.version}</B>"
bottom="${copyright}"
maxmemory="${javadoc.maxmemory}">
<doclet name ="${javadoc.doclet}"
path="${buildtools.jar}">
<param name="-baseurl" value="${javadoc.cvs}"/>
<param name="-d" value="${doc.dst}"/>
<param name="-author"/>
<param name="-version"/>
<param name="-J-Xmx${javadoc.maxmemory}"/>
</doclet>
</freehep.javadoc>
</target>
<target name="reldoc" depends="init" description="<gen-target> creates apidoc using FreeHEP doclet, for the release">
<freehep.defined property="jar" message="Target 'reldoc' only available without '-Djar=suffix' option"/>
<freehep.not.defined property="doc.dst" message="Target 'reldoc' only available with '-Dweb.dst=destination' option"/>
<mkdir dir="${doc.dst}"/>
<java classpath="${buildtools.jar}" classname="${buildtools.generatestatus}" output="${doc.dst}/status.log">
<arg line="${doc.dst}/status.xml ${projectname} ${dist.version} ${buildtools.generatestatus.packages}"/>
</java>
<java classpath="${buildtools.jar}" classname="${buildtools.transformstatus}" output="${doc.dst}/status.log">
<arg line="${doc.dst}/status.xml ${doc.dst}/status.html"/>
</java>
<freehep.javadoc packagenames="${javadoc.packages}"
additionalparam="-breakiterator"
overview="overview.html"
excludepackagenames="${javadoc.packages.excludes}"
sourcepath="${exp.srcpath};${srcpath}"
classpath="${exp.classpath};${classpath}"
destdir="${doc.dst}"
author="true"
version="true"
windowtitle="${javadoc.windowtitle}, Version ${dist.version}"
doctitle="${javadoc.doctitle}<br>Version ${dist.version}"
link="${javadoc.extdocs}"
header="<B>${javadoc.header}<br>Version ${dist.version}</B>"
footer="<B>${javadoc.footer}<br>Version ${dist.version}</B>"
bottom="${copyright}"
maxmemory="${javadoc.maxmemory}">
<doclet name ="${javadoc.doclet}"
path="${buildtools.jar}">
<param name="-d" value="${doc.dst}"/>
<param name="-author"/>
<param name="-version"/>
<param name="-J-Xmx${javadoc.maxmemory}"/>
</doclet>
</freehep.javadoc>
</target>
<target name="doc.clean" depends="init">
<freehep.not.defined property="doc.dst" message="Target 'doc.clean' only available with '-Ddoc.dst=destination' option"/>
<delete dir="${doc.dst}"/>
</target>
<!-- =================================================================== -->
<!-- Creates the web -->
<!-- =================================================================== -->
<target name="web" depends="init" description="<gen-target> creates web">
<freehep.not.defined property="web.dst" message="Target 'web' only available with '-Dweb.dst=destination' option"/>
<copy todir="${web.dst}">
<fileset dir="${web.src}"
includes="${web.src.includes}"
excludes="${web.src.excludes}"
/>
</copy>
</target>
<target name="web.clean" depends="init">
<freehep.not.defined property="web.dst" message="Target 'web.clean' only available with '-Dweb.dst=destination' option"/>
<delete dir="${web.dst}"/>
</target>
<!-- =================================================================== -->
<!-- Creates the distribution -->
<!-- =================================================================== -->
<target name="dist" depends="all, reldoc" description="<gen-target> creates distribution kits">
<freehep.defined property="jar" message="Target 'dist' only available without '-Djar=suffix' option"/>
<freehep.not.defined property="dist.dst" message="Target 'dist' only available with '-Ddist.dst=destination' option"/>
<freehep.not.defined property="dist.dst" message="Target 'dist' only available with '-Ddist.doc.dst=doc-destination' option"/>
<mkdir dir="${dist.doc.dst}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/lib"/>
<mkdir dir="${dist.dir}/doc"/>
<mkdir dir="${dist.dir}/doc/api"/>
<mkdir dir="${dist.dir}/src"/>
<mkdir dir="${dist.dir}/tools"/>
<mkdir dir="${dist.dst}"/>
<mkdir dir="${dist.dst}/${dist.version}"/>
<!-- remove the distribution files -->
<delete>
<fileset dir="${dist.dir}"
includes="*.tar.gz, *.zip, *.war"
/>
</delete>
<!-- Copy source files -->
<copy todir="${dist.dir}/src">
<fileset dir="${src}"
includes="${dist.src.includes}"
excludes="${dist.src.excludes}"
/>
</copy>
<!-- Copy libraries -->
<copy todir="${dist.dir}/lib">
<fileset dir="lib"
includes="${dist.lib.includes}"
excludes="${dist.lib.excludes}"
/>
</copy>
<!-- Copy documentation -->
<copy todir="${dist.dir}/doc">
<fileset dir="doc"
includes="${dist.doc.includes}"
excludes="${dist.doc.excludes}"
/>
</copy>
<!-- Copy tools -->
<copy todir="${dist.dir}/tools">
<fileset dir="tools"
includes="${dist.tools.includes}"
excludes="${dist.tools.excludes}"
/>
</copy>
<!-- Copy license and readme files -->
<copy todir="${dist.dir}">
<fileset dir="."
includes="${dist.readme.includes}"
excludes="${dist.readme.excludes}"
/>
</copy>
<!-- Copy API documentation -->
<copy todir="${dist.dir}/doc/api">
<fileset dir="${doc.dst}"/>
</copy>
<!-- Build distribution targets GENERIC -->
<war warfile="${projectname}-${dist.version}-doc.war"
webxml="doc/web.xml"
basedir="${dist.dir}/doc"
>
</war>
<!-- Build distribution targets WINDOWS -->
<fixcrlf srcDir="${dist.dir}"
cr="add"
eof="remove"
includes="${dist.fixcrlf.includes}"
excludes="${dist.fixcrlf.excludes}"
/>
<zip zipfile="${projectname}-${dist.version}.zip"
basedir="${dist.dir}"
includes="**"
excludes="doc, src"
/>
<zip zipfile="${projectname}-${dist.version}-doc.zip"
basedir="${dist.dir}"
includes="**"
excludes="${dist.readme.includes}, lib, src, bin"
/>
<zip zipfile="${projectname}-${dist.version}-src.zip"
basedir="${dist.dir}"
includes="**"
excludes="${dist.readme.includes}, lib, doc, bin"
/>
<!-- Build distribution targets UNIX -->
<fixcrlf srcDir="${dist.dir}"
cr="remove"
eof="remove"
includes="${dist.fixcrlf.includes}"
excludes="${dist.fixcrlf.excludes}"
/>
<tar tarfile="${projectname}-${dist.version}.tar"
basedir="${dist.dir}"
includes="**"
excludes="doc, src"
/>
<gzip zipfile="${projectname}-${dist.version}.tar.gz"
src="${projectname}-${dist.version}.tar"
/>
<freehep.delete file="${projectname}-${dist.version}.tar"/>
<tar tarfile="${projectname}-${dist.version}-doc.tar"
basedir="${dist.dir}"
includes="**"
excludes="${dist.readme.includes}, lib, src, bin"
/>
<gzip zipfile="${projectname}-${dist.version}-doc.tar.gz"
src="${projectname}-${dist.version}-doc.tar"
/>
<freehep.delete file="${projectname}-${dist.version}-doc.tar"/>
<tar tarfile="${projectname}-${dist.version}-src.tar"
basedir="${dist.dir}"
includes="**"
excludes="${dist.readme.includes}, lib, doc, bin"
/>
<gzip zipfile="${projectname}-${dist.version}-src.tar.gz"
src="${projectname}-${dist.version}-src.tar"
/>
<freehep.delete file="${projectname}-${dist.version}-src.tar"/>
<!-- Move the distribution files -->
<move file="${projectname}-${dist.version}-doc.war" todir="${dist.doc.dst}"/>
<move file="${projectname}-${dist.version}.zip" todir="${dist.dst}/${dist.version}"/>
<move file="${projectname}-${dist.version}-doc.zip" todir="${dist.dst}/${dist.version}"/>
<move file="${projectname}-${dist.version}-src.zip" todir="${dist.dst}/${dist.version}"/>
<move file="${projectname}-${dist.version}.tar.gz" todir="${dist.dst}/${dist.version}"/>
<move file="${projectname}-${dist.version}-doc.tar.gz" todir="${dist.dst}/${dist.version}"/>
<move file="${projectname}-${dist.version}-src.tar.gz" todir="${dist.dst}/${dist.version}"/>
</target>
<target name="dist.clean" depends="init">
<freehep.not.defined property="dist.dst" message="Target 'dist.clean' only available with '-Ddist.dst=destination' option"/>
<freehep.not.defined property="dist.version" message="Target 'dist.clean' only available with '-Ddist.version=version' option"/>
<delete dir="${dist.dst}/${dist.version}"/>
<freehep.not.defined property="dist.doc.dst" message="Target 'dist.clean' only available with '-Ddist.doc.dst=destination' option"/>
<delete dir="${dist.doc.dst}/${dist.version}/doc"/>
</target>
<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean" depends="init" description="< target> cleans up the jar and class files">
<freehep.defined property="jar" target="clean.jar"/>
<freehep.not.defined property="jar" target="clean.all"/>
</target>
<target name="clean.jar" depends="init.jar">
<freehep.defined property="src.dir" target="clean.jar.ok"/>
</target>
<target name="clean.jar.ok">
<freehep.delete dir="${src.dir}" packages="${packages}"/>
<freehep.delete file="${jar.dir}/${name}.jar"/>
</target>
<target name="clean.all">
<echo message=" Cleaning all"/>
<freehep.ant jars="${jars}" args="clean"/>
</target>
<!-- =================================================================== -->
<!-- Total cleanup -->
<!-- =================================================================== -->
<target name="veryclean" depends="clean" description="< target> cleans up the distribution, jar and class files">
<freehep.defined property="jar" target="veryclean.jar"/>
<freehep.not.defined property="jar" target="veryclean.all"/>
</target>
<target name="veryclean.jar">
</target>
<target name="veryclean.all">
<echo message=" Cleaning all"/>
<freehep.ant jars="${jars}" args="clean"/>
<freehep.ant jars="${wars}" args="war.clean"/>
<freehep.ant jars="${jlinks}" args="jlink.clean"/>
<freehep.ant args="dist.clean"/>
</target>
</project>