forked from apache/tapestry3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
762 lines (660 loc) · 28.6 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
<?xml version="1.0"?>
<!-- $Id$ -->
<!-- Top-level buildfile for the Tapestry module. -->
<project name="Tapestry Web Application Framework" default="install">
<property name="root.dir" value="./"/>
<property name="config.dir" value="${root.dir}/config"/>
<property file="${config.dir}/Version.properties"/>
<property file="${config.dir}/build.properties"/>
<property file="${config.dir}/common.properties"/>
<property name="javadoc.dir" value="web/doc/api"/>
<property name="private.dir" value="private"/>
<!-- Forrest prefers to put stuff in here. -->
<property name="build.dir" value="build"/>
<property environment="env"/>
<path id="jetty.classpath">
<fileset dir="${jetty.dir}">
<include name="lib/javax.servlet.jar"/>
<include name="lib/org.mortbay.jetty.jar"/>
<include name="ext/*.jar"/>
</fileset>
<!-- Needed to support JSP compilation -->
<pathelement location="${env.JAVA_HOME}/lib/tools.jar"/>
</path>
<path id="ext.dist.classpath">
<fileset dir="${ext.dist.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="workbench.classpath">
<fileset dir="${root.lib.dir}">
<include name="${framework.jar}"/>
<include name="${contrib.jar}"/>
<include name="${ext.dir}/*.jar"/>
<include name="${runtime.dir}/*.jar"/>
</fileset>
<pathelement location="config"/>
</path>
<path id="vlib.classpath">
<pathelement location="${vlibbeans.jar}"/>
<pathelement location="tapestry-examples/VlibBeans/jboss"/>
<pathelement location="${jboss.client.dir}/jboss-j2ee.jar"/>
<pathelement location="${jboss.client.dir}/jboss-client.jar"/>
<pathelement location="${jboss.client.dir}/jnp-client.jar"/>
<path refid="workbench.classpath"/>
</path>
<target name="clean" description="Cleans all sub-projects.">
<ant dir="framework" target="clean"/>
<ant dir="contrib" target="clean"/>
<ant dir="junit" target="clean"/>
<ant dir="tapestry-examples" target="clean"/>
<ant dir="doc/src" target="clean"/>
<delete dir="${private.dir}" quiet="true"/>
</target>
<target name="clean-all" depends="clean"
description="Cleans all subprojects and deletes installed frameworks, WARs and generated documentation."
>
<delete quiet="true">
<fileset dir="${root.lib.dir}">
<include name="*.jar"/>
<include name="examples/**"/>
</fileset>
</delete>
<delete dir="web/doc" quiet="true"/>
<delete dir="${build.dir}" quiet="true"/>
</target>
<target name="install" description="Builds all frameworks and examples."
depends="download-ext-install">
<!-- Each project has its own definitions for many properties.
inheritAll="false" ensures that definitions in this buildfile
doesn't override definitions in each project's buildfile. -->
<ant dir="framework" target="install" inheritAll="false"/>
<ant dir="contrib" target="install" inheritAll="false"/>
<ant dir="tapestry-examples" target="install" inheritAll="false"/>
</target>
<target name="build-workbench" description="Builds and installs the Workbench demo."
depends="download-ext-framework">
<ant dir="tapestry-examples/tapestry-workbench" target="install" inheritAll="false"/>
</target>
<target name="build-vlib" description="Builds and installs the Virtual Library demo."
depends="download-ext-framework,check-for-jboss-dir">
<ant dir="tapestry-examples/VlibBeans" target="install" inheritAll="false"/>
<ant dir="tapestry-examples/Vlib" target="install" inheritAll="false"/>
<ant dir="tapestry-examples/VlibEAR" target="install" inheritAll="false"/>
</target>
<target name="documentation" depends="download-ext-doc"
description="Builds the Tapestry documentation.">
<ant dir="doc/src" target="install" inheritAll="false">
<property name="ext.dist.dir" location="${ext.dist.dir}"/>
</ant>
<echo>Building site documentation using Forrest ...</echo>
<antcall target="site" inheritall="true"/>
</target>
<target name="junit" depends="check-for-jython-dir,download-ext-junit"
description="Run the JUnit test suite for Tapestry.">
<ant dir="junit" target="run" inheritAll="false">
<property name="ext.dist.dir" location="${ext.dist.dir}"/>
</ant>
</target>
<target name="clover" depends="check-for-clover-dir,check-for-jython-dir"
description="Execute the JUnit tests and generate Code Coverage report."
>
<ant dir="junit" target="clover" inheritAll="false">
<property name="ext.dist.dir" location="${ext.dist.dir}"/>
</ant>
</target>
<target name="dist"
description="Builds the Tapestry distribution from scratch."
depends="clean-all,install,junit,documentation,clover,javadoc">
<!-- After building, clean all the subprojects. -->
<antcall target="clean"/>
<!-- Now, build that actual distribution. -->
<antcall target="build-dist"/>
</target>
<property name="dist.root.dir" value="dist"/>
<property name="dist.base" value="Tapestry-${framework.version}"/>
<property name="dist.dir" value="${dist.root.dir}/${dist.base}"/>
<target name="build-dist"
description="Builds the Tapestry distribution files.">
<!-- Delete the base directory. -->
<delete dir="${dist.root.dir}" quiet="true"/>
<antcall target="build-dist-tarball"/>
</target>
<target name="build-dist-copy">
<echo>Copying to ${dist.dir} ...</echo>
<!-- Copy all the relevant files to the base directory. -->
<echo> Copying documentation ...</echo>
<copy todir="${dist.dir}" includeEmptyDirs="false">
<fileset dir=".">
<include name="build.xml"/>
<include name="*.html"/>
<include name="*.txt"/>
<include name="KEYS"/>
<!-- Skip HTML files in web, since those need
a seperate path, to provide filtering. -->
<exclude name="Readme.html"/>
<include name="config/**"/>
<include name="ext-dist/README.html"/>
<exclude name="lib/*"/>
<exclude name="lib/**"/>
<!-- Exclude Paint Shop Pro files (used to generate images
in various places) -->
<exclude name="**/*.psp"/>
<exclude name="**/*.jbf"/>
<!-- Don't include build.properties; that's specific to this build
environment. We ship a sample file instead. -->
<exclude name="config/build.properties"/>
<!-- This is where Eclipse puts classes. -->
<exclude name="bin/**"/>
<exclude name="${build.dir}"/>
<!-- It isn't a good idea to generate a distribution from a normal working
directory, since the <copy> will include things like backup files created
while editting. Better to check out the Tapestry module via anon CVS to
a temporary directory, configure build.properties, and build the
release there. -->
</fileset>
</copy>
<!-- The Readme.html file and several of the web pages
include a version number; copy w/ filtering. -->
<echo> Copying (and filtering) Readme.html ...</echo>
<copy todir="${dist.dir}" includeEmptyDirs="false">
<fileset dir=".">
<include name="Readme.html"/>
</fileset>
<filterset>
<filter token="VERSION" value="${framework.version}"/>
<filter token="OS_NAME" value="${os.name}"/>
<filter token="OS_VERSION" value="${os.version}"/>
<filter token="JAVA_VENDOR" value="${java.vendor}"/>
<filter token="JAVA_VM_VERSION" value="${java.vm.version}"/>
<filter token="COPY_YEARS" value="${copyright.years}"/>
<filter token="HOME_PAGE_URL"
value="http://jakarta.apache.org/tapestry"/>
<filter token="OGNL_VERSION" value="${ognl.version}"/>
<filter token="JAVASSIST_VERSION" value="${javassist.version}"/>
</filterset>
</copy>
<echo> Copying compiled and redistributable libraries ...</echo>
<copy todir="${dist.dir}/lib">
<fileset dir="${root.lib.dir}">
<include name="**/*.jar"/>
<exclude name="examples/*"/>
<exclude name="${ext.dir}/ognl-*.jar"/>
<exclude name="${ext.dir}/javassist-*.jar"/>
<include name="**/LICENSE*"/>
</fileset>
</copy>
<echo> Copying Tapestry Tag Library Descriptor ...</echo>
<copy
file="framework/META-INF/taglib.tld"
tofile="${dist.dir}/lib/tapestry-${framework.version}.tld"/>
<echo> Copying framework and examples source code ...</echo>
<copy todir="${dist.dir}" includeEmptyDirs="false">
<fileset dir=".">
<include name="framework/**"/>
<include name="contrib/**"/>
<include name="examples/**"/>
<!-- These two aren't quite ready for primetime. -->
<exclude name="examples/DevelopmentEnvironment/**"/>
<exclude name="examples/Tutorial2/**"/>
<!-- These are thumnail files that turn up in directories that contain images. These
are not stored in CVS and should not be part of the distribution. -->
<exclude name="**/Thumbs.db"/>
<exclude name="**/pspbrwse.jbf"/>
<exclude name="**/classes/"/>
</fileset>
</copy>
<property name="web.dir" value="${dist.dir}/web"/>
<property name="dtd.dir" value="${web.dir}/dtd"/>
<echo> Copying Tapestry DTDs ...</echo>
<copy todir="${dtd.dir}" flatten="true">
<fileset dir="framework/src">
<include name="**/*.dtd"/>
</fileset>
</copy>
<!-- Copy over javadoc, component references, and docs generated from docbook.
We tend to copy the same files too many times (i.e., the builds for the
TapestryUsersGuide could generate the HTML files directly into the dist), but
it's still fast *enough* so not to fiddle. -->
<echo> Copying documentation, JavaDoc, Clover report ...</echo>
<copy todir="${web.dir}" includeEmptyDirs="false">
<fileset dir="web">
<!-- Exclude the top level stuff (any remnants of the old, static web site).
Include all the docs and reports generated below. -->
<exclude name="*.html"/>
<include name="**/*"/>
</fileset>
<fileset dir="${build.dir}/site"/>
</copy>
</target>
<target name="build-dist-tarball"
description="Builds the tarball distributions."
depends="build-dist-copy">
<property name="bin.tar.gz" value="${dist.dir}-bin.tar.gz"/>
<property name="src.tar.gz" value="${dist.dir}-src.tar.gz"/>
<tar tarfile="${bin.tar.gz}" longfile="gnu" compression="gzip">
<tarfileset dir="${dist.root.dir}" id="dist.bin.set">
<include name="${dist.base}/*"/>
<include name="${dist.base}/config/**"/>
<include name="${dist.base}/lib/**"/>
<!-- Have to include a lot of Workbench source in the binary distro, because
it has to be compiled and built using the dynamically downloaded non-ASL
libraries (such as OGNL). -->
<include name="${dist.base}/examples/Workbench/**"/>
<exclude name="${dist.base}/examples/Workbench/.build/**"/>
<exclude name="${dist.base}/examples/Workbench/image-src/**"/>
<include name="${dist.base}/examples/Vlib/**"/>
<include name="${dist.base}/examples/VlibBeans/**"/>
<include name="${dist.base}/examples/VlibEAR/**"/>
<include name="${dist.base}/examples/wap/**"/>
<include name="${dist.base}/examples/build.xml"/>
<!-- Don't ship the code coverage report; it's huge. -->
<include name="${dist.base}/web/**"/>
<exclude name="${dist.base}/web/doc/clover/**"/>
</tarfileset>
</tar>
<tar tarfile="${src.tar.gz}" longfile="gnu" compression="gzip">
<tarfileset dir="${dist.root.dir}" id="dist.src.set">
<!-- Include the sub-projects excluded from the -bin distro. -->
<include name="${dist.base}/framework/**"/>
<include name="${dist.base}/contrib/**"/>
</tarfileset>
</tar>
<property name="bin.zip" value="${dist.dir}-bin.zip"/>
<property name="src.zip" value="${dist.dir}-src.zip"/>
<zip destfile="${bin.zip}">
<zipfileset refid="dist.bin.set"/>
</zip>
<zip destfile="${src.zip}">
<zipfileset refid="dist.src.set"/>
</zip>
<!-- Create the web distribution (to be put up on the web site). This *does*
include the code coverage report. -->
<property name="web.tar.gz"
value="${dist.root.dir}/Tapestry-Web-${framework.version}.tar.gz"/>
<tar basedir="${web.dir}" tarfile="${web.tar.gz}" longfile="gnu"
compression="gzip"/>
</target>
<target name="javadoc"
description="Generate API documentation for the framework and examples."
>
<mkdir dir="${javadoc.dir}"/>
<javadoc author="true" version="true" destdir="${javadoc.dir}"
splitindex="true" windowtitle="Tapestry API ${framework.version}">
<doctitle>Tapestry ${framework.version} API</doctitle>
<package name="org.apache.tapestry.*"/>
<link href="http://java.sun.com/j2se/1.3/docs/api/"
offline="true" packageListLoc="package-lists/jdk"/>
<link href="http://java.sun.com/j2ee/sdk_1.2.1/techdocs/api/"
offline="true" packageListLoc="package-lists/j2ee"/>
<link href="http://jakarta.apache.org/log4j/docs/api/"
offline="true" packageListLoc="package-lists/log4j"/>
<link href="http://www.junit.org/junit/javadoc/3.7/" offline="true"
packageListLoc="package-lists/junit"/>
<link href="http://jakarta.apache.org/oro/api/" offline="true"
packageListLoc="package-lists/jakarta-oro"/>
<group title="Tapestry Framework"
packages="org.apache.tapestry:org.apache.tapestry.*"/>
<group title="Tapestry Contributions Framework"
packages="org.apache.tapestry.contrib.*"/>
<sourcepath>
<pathelement location="framework/src"/>
<pathelement location="contrib/src"/>
</sourcepath>
<classpath>
<path refid="vlib.classpath"/>
<path refid="ext.dist.classpath"/>
<fileset dir="${root.lib.dir}">
<include name="${j2ee.dir}/*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<target name="run-workbench" depends="check-for-jetty-dir,build-workbench"
description="Runs the Tapestry Workbench using Jetty.">
<delete dir="${private.dir}" quiet="true"/>
<mkdir dir="${private.dir}"/>
<echo>Running Tapestry Workbench on port 8080 ...</echo>
<java classname="org.mortbay.jetty.Server" fork="true" maxmemory="128M">
<classpath>
<path refid="jetty.classpath"/>
</classpath>
<arg value="config/jetty-workbench.xml"/>
<!-- Enable debugging when running the tutorial -->
<jvmarg line="-showversion -Xdebug -Xnoagent"/>
<jvmarg
line="-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=20150"
/>
<!-- Jetty can get easily confused (under NT) unless this is turned off. -->
<sysproperty key="org.mortbay.util.FileResource.checkAliases"
value="false"/>
<sysproperty key="org.apache.tapestry.asset.dir" value="${private.dir}"
/>
<sysproperty key="org.apache.tapestry.asset.URL" value="/private"/>
</java>
</target>
<!-- ===================================================================================
JBoss 3.0.6 auto configuration
Configures a JBoss 3.0.6 with a new configuration, tapestry. Part of the configuration
comes with the Tapestry distribution; part is copied from the JBoss default server
configuration.
This only works with JBoss 3.0.6; other releases differ enough that this
simple script is broken.
==================================================================================== -->
<property name="tapestry.dir" value="${jboss.dir}/server/tapestry"/>
<property name="tapestry.conf.dir" value="${tapestry.dir}/conf"/>
<property name="tapestry.lib.dir" value="${tapestry.dir}/lib"/>
<property name="tapestry.db.dir" value="${tapestry.dir}/db"/>
<property name="tapestry.deploy.dir" value="${tapestry.dir}/deploy"/>
<property name="tapestry.private.dir"
value="${tapestry.dir}/tmp/${private.dir}"/>
<property name="jboss.server.default.dir"
value="${jboss.dir}/server/default"/>
<target name="configure" depends="check-for-jboss-dir,download-ext-examples"
description="Configure the JBoss 3.0.6 server and setup the Tapestry database."
>
<delete dir="${tapestry.lib.dir}" quiet="true"/>
<mkdir dir="${tapestry.lib.dir}"/>
<copy todir="${tapestry.lib.dir}" flatten="true">
<fileset dir="${root.lib.dir}">
<include name="*-${framework.version}.jar"/>
<include name="${ext.dir}/*.jar"/>
</fileset>
<fileset dir="${ext.dist.dir}">
<include name="mckoidb*.jar"/>
</fileset>
<fileset dir="${jboss.server.default.dir}/lib">
<!-- Could do a careful analysis of just what we need and copy only that,
but this is good for now. -->
<include name="*.jar"/>
</fileset>
</copy>
<!-- Delete, recreate and copy -->
<delete dir="${tapestry.conf.dir}" quiet="true"/>
<mkdir dir="${tapestry.conf.dir}"/>
<copy todir="${tapestry.conf.dir}" filtering="true">
<fileset dir="config/jboss/conf"/>
<filterset>
<filter token="jboss.dir" value="${jboss.dir}"/>
<filter token="user.dir" value="${user.dir}"/>
</filterset>
</copy>
<mkdir dir="${tapestry.deploy.dir}"/>
<copy todir="${tapestry.deploy.dir}">
<fileset dir="${jboss.server.default.dir}/deploy">
<!-- Skip one file that is replaced -->
<exclude name="jbossweb.sar/META-INF/jboss-service.xml"/>
<include name="*"/>
<include name="**/*"/>
</fileset>
</copy>
<!-- Technically, this isn't necessary any longer (the filtering part),
but it does no harm, and may be needed again in the future. -->
<copy todir="${tapestry.deploy.dir}" filtering="true">
<fileset dir="config/jboss/deploy"/>
<filterset>
<filter token="user.dir" value="${user.dir}"/>
<filter token="jboss.dir" value="${jboss.dir}"/>
</filterset>
</copy>
<!-- Set a flag if the vlib already exists, then extract it if necessary. -->
<mkdir dir="${tapestry.db.dir}"/>
<available file="${tapestry.db.dir}/tapestry.conf"
property="tapestry.db.exists"/>
<antcall target="unpack-tapestry-database"/>
</target>
<target name="unpack-tapestry-database"
description="Unpacks the Tapestry demos database."
unless="tapestry.db.exists">
<unzip src="config/jboss/tapestry-db.zip" dest="${tapestry.db.dir}"/>
</target>
<target name="deploy-jboss-demos" depends="check-for-jboss-dir,build-workbench,build-vlib"
description="Deploys the demos and Tapestry frameworks into JBoss.">
<copy todir="${tapestry.deploy.dir}">
<fileset dir="${examples.dir}">
<include name="${vlib.ear}"/>
<include name="${workbench.war}"/>
</fileset>
</copy>
</target>
<target name="run-jboss" depends="deploy-jboss-demos"
description="Launch the JBoss application server.">
<delete dir="${tapestry.private.dir}" quiet="true"/>
<mkdir dir="${tapestry.private.dir}"/>
<java fork="true" dir="${jboss.dir}/bin" classname="org.jboss.Main">
<!-- Launch using the tapestry configuration, not the default. -->
<arg line="--configuration=tapestry"/>
<classpath>
<pathelement location="${jboss.dir}/bin/run.jar"/>
<!-- Include this so that the JMX control panel (based on JSPs) can work. -->
<pathelement location="${java.home}/../lib/tools.jar"/>
</classpath>
<!-- Enable debugging -->
<jvmarg line="-showversion -Xdebug -Xnoagent"/>
<jvmarg
line="-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=20500"
/>
<!-- These allow private assets to be exported as static
files. This coordinates with portions of
config/deploy/jbossweb.sar/META-INF/jboss-service.xml -->
<sysproperty key="org.apache.tapestry.asset.dir"
value="${tapestry.private.dir}"/>
<sysproperty key="org.apache.tapestry.asset.URL" value="/private"/>
<!-- The following is probably only necessary under Windows. Jetty gets
tripped up by the fact that pathnames are case-insensitive. -->
<sysproperty key="org.mortbay.util.FileResource.checkAliases"
value="false"/>
</java>
</target>
<target name="deploy-tomcat"
depends="check-for-tomcat-dir,build-workbench"
description="Deploys the Workbench application into Tomcat.">
<copy file="${examples.dir}/${workbench.war}" todir="${tomcat.dir}/webapps"/>
</target>
<target name="check-for-jboss-dir">
<available property="exists.jboss.dir" type="dir" file="${jboss.dir}"/>
<fail unless="jboss.dir"
message="Property jboss.dir not specified in config/build.properties."
/>
<fail unless="exists.jboss.dir"
message="Directory ${jboss.dir} (jboss.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-tomcat-dir">
<available property="exists.tomcat.dir" type="dir" file="${tomcat.dir}"
/>
<fail unless="tomcat.dir"
message="Property tomcat.dir not specified in config/build.properties."
/>
<fail unless="exists.tomcat.dir"
message="Directory ${tomcat.dir} (tomcat.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-clover-dir">
<available property="exists.clover.dir" type="dir" file="${clover.dir}"
/>
<fail unless="clover.dir"
message="Property clover.dir not specified in config/build.properties."
/>
<fail unless="exists.clover.dir"
message="Directory ${clover.dir} (clover.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-jython-dir">
<available property="exists.jython.dir" type="dir" file="${jython.dir}"
/>
<fail unless="jython.dir"
message="Property jython.dir not specified in config/build.properties."
/>
<fail unless="exists.jython.dir"
message="Directory ${jython.dir} (jython.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-jetty-dir">
<available property="exists.jetty.dir" type="dir" file="${jetty.dir}" />
<fail unless="jetty.dir"
message="Property jetty.dir not specified in config/build.properties."
/>
<fail unless="exists.jetty.dir"
message="Directory ${jetty.dir} (jetty.dir from config/build.properties) does not exist."
/>
</target>
<target name="check-for-forrest-dir" depends="check-defined-forrest-dir,check-downloaded-forrest">
</target>
<target name="site" description="Generates static HTML documentation" depends="check-for-forrest-dir">
<ant antfile="${installed.forrest.dir}/forrest.antproxy.xml" target="site">
<property name="forrest.home" value="${installed.forrest.dir}"/>
</ant>
</target>
<target name="validate" depends="check-for-forrest-dir" description="Validates XML documentation files">
<ant antfile="${installed.forrest.home}/forrest.antproxy.xml" target="validate"/>
</target>
<target name="check-defined-forrest-dir" if="forrest.dir">
<available property="exists.forrest.dir" type="dir" file="${forrest.dir}"/>
<fail unless="exists.forrest.dir"
message="Directory ${forrest.dir} (forrest.dir from config/build.properties) does not exist."/>
<property name="installed.forrest.dir" value="${forrest.dir}"/>
</target>
<target name="check-downloaded-forrest" unless="forrest.home" depends="proxyflags"
description="Download forrest package">
<echo message="Property forrest.dir not specified in config/build.properties"/>
<echo message="Downloading Forrest"/>
<antcall target="downloadzip">
<param name="sourcefile" value="${forrestdl.loc}"/>
<param name="dlfile" value="${forrestdl.ant.xml}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
<property name="installed.forrest.dir" value="${forrestdl.home}"/>
</target>
<target name="download-ext-install"
depends="download-ext-framework, download-ext-examples"
description="Download binary packages for the install target"/>
<target name="download-ext-framework" depends="proxyflags"
description="Download binary packages for compiling the framework and examples" >
<mkdir dir="${ext.download.dir}" />
<antcall target="installgz">
<param name="sourcefile" value="${jdom.loc}"/>
<param name="dlfile" value="${jdom.jar}"/>
<param name="destfile" value="${jdom.ext.jar}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
<antcall target="installzip">
<param name="sourcefile" value="${javassist.loc}"/>
<param name="dlfile" value="${javassist.jar}"/>
<param name="destfile" value="${javassist.ext.jar}"/>
<param name="destdir" value="${javassist.dest}"/>
</antcall>
<antcall target="installjar">
<param name="sourcefile" value="${ognl.loc}"/>
<param name="destfile" value="${ognl.dest}"/>
</antcall>
</target>
<target name="download-ext-examples" depends="proxyflags"
description="Download binary packages for compiling the examples" >
<mkdir dir="${ext.download.dir}" />
<antcall target="installzip">
<param name="sourcefile" value="${mckoi.loc}"/>
<param name="dlfile" value="${mckoi.jar}"/>
<param name="destfile" value="${mckoi.ext.jar}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
</target>
<target name="download-ext-junit" depends="proxyflags"
description="Download binary packages for compiling the unit tests" >
<mkdir dir="${ext.download.dir}" />
<antcall target="installzip">
<param name="sourcefile" value="${junit.loc}"/>
<param name="dlfile" value="${junit.jar}"/>
<param name="destfile" value="${junit.ext.jar}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
<antcall target="installgz">
<param name="sourcefile" value="${jdom.loc}"/>
<param name="dlfile" value="${jdom.jar}"/>
<param name="destfile" value="${jdom.ext.jar}"/>
<param name="destdir" value="${ext.download.dir}"/>
</antcall>
</target>
<target name="download-ext-doc" depends="proxyflags"
description="Download binary packages for compiling the documentation" >
<mkdir dir="${ext.download.dir}" />
<antcall target="downloadfile">
<param name="sourcefile" value="${docbookxml.loc}"/>
<param name="destfile" value="${docbookxml.file}"/>
<param name="destdir" value="${ext.dist.dir}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${docbookxsl.loc}"/>
<param name="destfile" value="${docbookxsl.file}"/>
<param name="destdir" value="${ext.dist.dir}"/>
</antcall>
</target>
<target name="download-alert" unless="download-alert-shown">
<echo>
*********************************************************************************
* Due to the restrictions of the Apache Software License 2.0, it is necessary *
* to download some additional libraries that use non-ASL licenses. You should *
* be aware that redistribution of these files are regulated by their individual *
* licenses. If you experience problems with the download, consult the file *
* ext-dist/README.html for details on how to configure the build to work *
* around a firewall. *
*********************************************************************************
</echo>
<!-- This doesn't work so well ... the property must be getting lost after
each antcall completes. -->
<property name="download-alert-shown" value="you-betcha"/>
</target>
<target name="installjar" unless="exist" depends="setproxy,testexistdest,download-alert">
<get src="${sourcefile}" dest="${destfile}"/>
</target>
<target name="installgz" unless="exist" depends="setproxy,testexistdest">
<antcall target="downloadgz"/>
<copy file="${dlfile}" tofile="${destfile}"/>
</target>
<target name="downloadgz" unless="exist" depends="setproxy,testexist,download-alert">
<mkdir dir="${ext.download.dir}"/>
<!-- Download and extract the package -->
<get src="${sourcefile}" dest="${ext.download.dir}/file.tar.gz" />
<gunzip src="${ext.download.dir}/file.tar.gz" dest="${ext.download.dir}/file.tar"/>
<untar src="${ext.download.dir}/file.tar" dest="${ext.download.dir}"/>
<delete file="${ext.download.dir}/file.tar"/>
<delete file="${ext.download.dir}/file.tar.gz"/>
</target>
<target name="installzip" unless="exist" depends="setproxy,testexistdest">
<antcall target="downloadzip"/>
<copy file="${dlfile}" tofile="${destfile}"/>
</target>
<target name="downloadzip" unless="exist" depends="setproxy,testexist,download-alert">
<!-- Download and extract the package -->
<mkdir dir="${ext.download.dir}"/>
<get src="${sourcefile}" dest="${ext.download.dir}/file.zip" />
<mkdir dir="${destdir}" />
<unzip src="${ext.download.dir}/file.zip" dest="${destdir}"/>
<delete file="${ext.download.dir}/file.zip"/>
</target>
<target name="downloadfile" unless="exist" depends="setproxy,testexistdest">
<!-- Download extract the file -->
<mkdir dir="${destdir}" />
<get src="${sourcefile}" dest="${destfile}" />
</target>
<target name="proxyflags">
<!-- check proxy parameters. -->
<condition property="useproxy">
<equals arg1="${proxy.use}" arg2="on" />
</condition>
</target>
<target name="setproxy" if="useproxy">
<taskdef name="setproxy"
classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
<setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
<echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
</target>
<target name="testexistdest">
<echo message="Testing for ${destfile}"/>
<available file="${destfile}" property="exist"/>
</target>
<target name="testexist">
<echo message="Testing for ${dlfile}"/>
<available file="${dlfile}" property="exist"/>
</target>
</project>