forked from apache/struts1
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuild.xml
executable file
·1070 lines (864 loc) · 42 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
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<project name="Struts" default="compile.library" basedir=".">
<!--
Struts main build.xml file for building everything related to Struts.
This script will delegate some of it's tasks to the other build*.xml
scripts (build-webapps.xml, build-tests.xml, ...
For a complete list of executable tasks use -projecthelp when calling
this build file.
-->
<!-- ========== Prerequisite Properties =================================== -->
<!--
REQUIRED PROPERTIES
Each of these properties MUST be set in one of the following ways:
* on the "ant" command line
* in a "build.properties" file in the base directory
* in a "build.properties" file in your user home directory
antlr.jar The path to the JAR file of the ANTLR
package.
[Version 2.7.2 or later]
commons-beanutils.jar The path to the JAR file of the Jakarta
Commons Beanutils package.
[Version 1.6.1 or later]
commons-digester.jar The path to the JAR file of the Jakarta
Commons Digester package.
[Version 1.5 or later]
commons-fileupload.jar The path to the JAR file of the Jakarta
Commons FileUpload package.
[Version 1.0 or later]
commons-logging.jar The path to the JAR file of the Jakarta
Commons Logging package.
[Version 1.0.3 or later]
commons-validator.jar The path to the JAR file of the Jakarta
Commons Validator package.
[Version 1.1.0 or later]
jakarta-oro.jar The path to the JAR file of the Jakarta
ORO package.
[Version 2.0.7 or later]
jdbc20ext.jar The path to the JAR file for the JDBC 2.0
Optional Package APIs.
servlet.jar The path to the Servlet API classes to
compile against.
[Version 2.2 or 2.3]
OPTIONAL PROPERTIES
Each of these properties MAY be set in one of the following ways:
* on the "ant" command line
* in a "build.properties" file in the base directory
* in a "build.properties" file in your user home directory
If not set, the default, as described below, will be used instead.
ant.jar The path to the ant.jar that is being
used to build from this script. This is
required only when executing the
"generate.taglib.doc" target.
catalina.home The path to the Tomcat 4.0 installation.
This is required only when executing the
"deploy.catalina" target.
catalina.url URL of the Tomcat 4.1.x manager app for
dynamic installation.
catalina.username Username for the Tomcat 4.1.x manager app
for dynamic installation.
catalina.password Password for the Tomcat 4.1.x manager app
for dynamic installation.
jsp.jar The path to the JSP API classes to compile
against, if you are using JSP 2.0, where
these classes have been separated from
servlet.jar. If you are using JSP 1.1 or
1.2, leave this property unset.
tomcat.home The path to the Tomcat 3.x installation.
This is required only when executing the
"deploy.tomcat" target.
xerces.jar The path to the Xerces classes to copy.
This is required only when executing the
"deploy.catalina" target.
-->
<!-- Load local and user build preferences -->
<property file="build.properties"/>
<property file="../build.properties"/>
<property file="${user.home}/build.properties"/>
<!-- Default values for unspecified properties -->
<property name="catalina.home" value="../jakarta-tomcat-4.0/build"/>
<property name="pmd.rulesets" value="rulesets/imports.xml,rulesets/unusedcode.xml,rulesets/basic.xml,rulesets/strings.xml"/>
<property name="pmd.report" value="pmdreport.html"/>
<!--
Location of other Struts subprojects
These default values assume that the checked out locations are the same
as the full repository paths, and that you are building the trunk.
-->
<property name="struts.el.home" value="${basedir}/contrib/el/"/>
<!-- ========== Initialization Properties ================================= -->
<!--
These property values may optionally be overridden with property
settings from an "ant" command line, the "build.properties" file
in this directory, the "build.properties" file in your home
directory, or from settings in a superior build.xml script.
-->
<!-- Output directory name for all files generated by the build process -->
<property name="build.home" value="${basedir}/target"/>
<!-- Should Java compilations set the debug compiler option? -->
<property name="compile.debug" value="true" />
<!-- Should Java compilations set the deprecation compiler option? -->
<property name="compile.deprecation" value="false" />
<!-- Should Java compilations set the optimize compiler option? -->
<property name="compile.optimize" value="true" />
<!-- Name of the core struts library -->
<property name="app.name" value="struts"/>
<!-- Name of the project -->
<property name="project.name" value="struts"/>
<!-- Version of the project -->
<property name="project.version" value="1.2.10-SNAPSHOT"/>
<!-- ========== Derived Properties ======================================== -->
<!--
These property values are derived from values defined above, and
generally should NOT be overridden by command line settings
-->
<!-- The base directory for distribution targets -->
<property name="dist.home" value="dist" />
<!-- The base directory for release targets -->
<property name="release.home" value="release" />
<!-- Source directory -->
<property name="src.dir" value="src"/>
<!-- Source directory for core struts library -->
<property name="src.share.dir" value="${src.dir}/share"/>
<!-- Source directory for non-Cactus unit tests -->
<property name="src.test.dir" value="${src.dir}/test"/>
<!-- Directory where core struts library configurations files are stored -->
<property name="conf.share.dir" value="conf/share"/>
<!-- Directory where test configurations files are stored -->
<property name="conf.test.dir" value="conf/test"/>
<!-- Directory where binary release files are staged -->
<property name="stage.bin.dir" value="${release.home}/stage/bin"/>
<!-- Directory where library release files are staged -->
<property name="stage.lib.dir" value="${release.home}/stage/lib"/>
<!-- Directory where source release files are staged -->
<property name="stage.src.dir" value="${release.home}/stage/src"/>
<!-- Directory where release builds are prepared for upload -->
<property name="upload.dir" value="${release.home}/upload"/>
<!-- Base file name for upload files -->
<property name="upload.file.base" value="${project.name}-${project.version}"/>
<!-- Doc directory -->
<property name="doc.dir" value="doc"/>
<!-- Web directory -->
<property name="web.dir" value="web"/>
<!-- This is only used if you execute "ant download-dependencies" -->
<property name="libdir" value="${basedir}/lib" />
<path id="downloaded.lib.classpath">
<fileset dir="${libdir}">
<include name="*.jar"/>
</fileset>
</path>
<!-- Compilation Classpath -->
<path id="compile.classpath">
<pathelement location="${commons-beanutils.jar}"/>
<pathelement location="${commons-digester.jar}"/>
<pathelement location="${commons-fileupload.jar}"/>
<pathelement location="${commons-logging.jar}"/>
<pathelement location="${commons-validator.jar}"/>
<pathelement location="${jakarta-oro.jar}"/>
<pathelement location="${jdbc20ext.jar}"/>
<pathelement location="${jsp.jar}"/>
<pathelement location="${servlet.jar}"/>
<pathelement location="${antlr.jar}"/>
<pathelement location="${xerces.jar}"/>
<!-- this is harmless if not used -->
<path refid="downloaded.lib.classpath"/>
</path>
<!-- PMD Classpath -->
<path id="pmd.classpath">
<fileset dir="${pmd.home}/lib">
<include name="*.jar"/>
</fileset>
</path>
<!-- ========== Executable Targets ======================================== -->
<!--
The "init" target evaluates "available" expressions as necessary
to modify the behavior of this script and print some information on
screen
-->
<target name="init">
<echo message="--------- ${project.name} ${project.version} ---------"/>
<echo message=""/>
<echo message="java.class.path = ${java.class.path}"/>
<echo message="java.home = ${java.home}"/>
<echo message="user.home = ${user.home}"/>
<filter token="version" value="${project.version}"/>
<tstamp>
<format property="year" pattern="yyyy"/>
</tstamp>
</target>
<target name="download-dependencies">
<!--
To use this Maven-like freedom with respect to dependency setup,
do the following:
- run ant as you normally would, but add the following target to the command
line:
download-dependencies
For example:
C:>myproject\ant download-dependencies dist
-->
<mkdir dir="${libdir}"/>
<get dest="${libdir}/commons-beanutils.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/commons-beanutils/jars/commons-beanutils-1.7.0.jar"/>
<get dest="${libdir}/commons-digester.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/commons-digester/jars/commons-digester-1.6.jar"/>
<get dest="${libdir}/commons-fileupload.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/commons-fileupload/jars/commons-fileupload-1.0.jar"/>
<get dest="${libdir}/commons-logging.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.4.jar"/>
<get dest="${libdir}/commons-validator.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/commons-validator/jars/commons-validator-1.1.4.jar"/>
<get dest="${libdir}/jakarta-oro.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/oro/jars/oro-2.0.7.jar"/>
<get dest="${libdir}/xerces.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/xml-apis/jars/xml-apis-2.0.2.jar"/>
<get dest="${libdir}/antlr.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/antlr/jars/antlr-2.7.2.jar"/>
<get dest="${libdir}/servlet.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/servletapi/jars/servletapi-2.2.jar"/>
<get dest="${libdir}/jstl-1.0.6.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/jstl/jars/jstl-1.0.6.jar"/>
<get dest="${libdir}/standard-1.0.6.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/taglibs/jars/standard-1.0.6.jar"/>
<get dest="${libdir}/junit-3.8.1.jar"
usetimestamp="true" ignoreerrors="true"
src="http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar"/>
<property name="commons-beanutils.jar" value="${libdir}/commons-beanutils.jar"/>
<property name="commons-digester.jar" value="${libdir}/commons-digester.jar"/>
<property name="commons-fileupload.jar" value="${libdir}/commons-fileupload.jar"/>
<property name="commons-logging.jar" value="${libdir}/commons-logging.jar"/>
<property name="commons-validator.jar" value="${libdir}/commons-validator.jar"/>
<property name="jakarta-oro.jar" value="${libdir}/jakarta-oro.jar"/>
<property name="xerces.jar" value="${libdir}/xerces.jar"/>
<property name="antlr.jar" value="${libdir}/antlr.jar"/>
<property name="servlet.jar" value="${libdir}/servlet.jar"/>
<property name="jstl.jar" value="${libdir}/jstl-1.0.6.jar"/>
<property name="jstl-standard.jar" value="${libdir}/standard-1.0.6.jar"/>
<property name="junit.jar" value="${libdir}/junit-3.8.1.jar"/>
</target>
<!--
Create directories and copy files for the core struts library
-->
<target name="prepare.library" depends="init">
<mkdir dir="${build.home}/library/classes/META-INF"/>
<mkdir dir="${build.home}/library/classes/META-INF/tlds"/>
<mkdir dir="${build.home}/library/classes/org/apache/struts/resources"/>
<copy file="LICENSE.txt"
tofile="${build.home}/library/classes/META-INF/LICENSE"/>
<copy file="NOTICE.txt"
tofile="${build.home}/library/classes/META-INF/NOTICE"/>
<copy todir="${build.home}/library/classes/org/apache/struts/resources">
<fileset dir="${conf.share.dir}" includes="**/*.dtd"/>
</copy>
<copy todir="${build.home}/conf" filtering="on">
<fileset dir="${conf.share.dir}" includes="*.MF"/>
</copy>
<copy file="${commons-beanutils.jar}"
tofile="${build.home}/library/commons-beanutils.jar"/>
<copy file="${commons-digester.jar}"
tofile="${build.home}/library/commons-digester.jar"/>
<copy file="${commons-fileupload.jar}"
tofile="${build.home}/library/commons-fileupload.jar"/>
<copy file="${commons-logging.jar}"
tofile="${build.home}/library/commons-logging.jar"/>
<copy file="${commons-validator.jar}"
tofile="${build.home}/library/commons-validator.jar"/>
<copy file="${jakarta-oro.jar}"
tofile="${build.home}/library/jakarta-oro.jar"/>
<copy file="${antlr.jar}" failonerror="false"
tofile="${build.home}/library/antlr.jar"/>
<!-- Compile-time dependency only
<copy file="${jdbc20ext.jar}"
tofile="${build.home}/library/jdbc2_0-stdext.jar"/>
-->
</target>
<!--
Prepare static directories for web applications
-->
<target name="static.webapps">
<ant antfile="build-webapps.xml" target="static"/>
</target>
<!--
Compile core struts library directory components
-->
<target name="compile.library" depends="prepare.library"
description="Compile Struts library files">
<javac srcdir="${src.share.dir}"
destdir="${build.home}/library/classes"
debug="${compile.debug}"
optimize="${compile.optimize}"
deprecation="${compile.deprecation}">
<classpath refid="compile.classpath"/>
</javac>
<copy todir="${build.home}/library/classes">
<fileset dir="${src.share.dir}" includes="**/*.properties"/>
</copy>
<copy todir="${build.home}/library">
<fileset dir="${conf.share.dir}" includes="*.dtd"/>
<fileset dir="${conf.share.dir}" includes="*.tld"/>
<fileset dir="${conf.share.dir}" includes="*.xml"/>
</copy>
<style basedir="${doc.dir}/userGuide"
destdir="${build.home}/library"
extension=".tld"
style="${doc.dir}/stylesheets/tld.xsl"
includes="struts-*.xml"/>
<copy todir="${build.home}/library/classes/META-INF/tlds">
<fileset dir="${build.home}/library" includes="struts-*.tld"/>
</copy>
<copy todir="${build.home}/library/classes/META-INF/tlds" overwrite="true">
<fileset dir="${build.home}/library" includes="struts-*.tld"/>
<mapper type="regexp" from="^(.*)\.tld$$" to="\1-1.1.tld"/>
</copy>
<replace dir="${build.home}/library/classes/META-INF/tlds" >
<include name="*-1.1.tld"/>
<replacefilter token="http://struts.apache.org/tags"
value="http://jakarta.apache.org/struts/tags"/>
</replace>
<jar jarfile="${build.home}/library/${app.name}.jar"
manifest="${build.home}/conf/MANIFEST.MF"
basedir="${build.home}/library/classes"
includes="**"/>
</target>
<!--
Compile code for web applications
-->
<target name="compile.webapps" depends="compile.library,static.webapps"
description="Compile Struts web applications">
<ant antfile="build-webapps.xml" target="compile"/>
</target>
<!--
Create Javadoc documentation
-->
<target name="compile.javadoc"
description="Generate JavaDoc API docs">
<delete dir="${build.home}/documentation/api"/>
<mkdir dir="${build.home}/documentation/api"/>
<javadoc sourcepath="${src.share.dir}"
destdir="${build.home}/documentation/api"
classpath="${servlet.jar}:${jsp.jar}:${jdbc20ext.jar}"
packagenames="org.apache.struts.*"
author="true"
private="true"
use="true"
version="true"
windowtitle="Apache Struts API Documentation"
doctitle="<h1>Apache Struts Framework (Version ${project.version})</h1>"
bottom="Copyright © 2000-${year} - The Apache Software Foundation">
<classpath refid="compile.classpath"/>
</javadoc>
</target>
<!--
Generate new taglib JavaDoc-like documentation
-->
<target name="generate-reports" if="ant.jar">
<mkdir dir="${dist.home}/contrib"/>
<ant dir="${basedir}/contrib/tag-doc"
target="clean" inheritAll="false"/>
<ant dir="${basedir}/contrib/tag-doc"
target="dist" inheritAll="true"/>
<ant dir="${basedir}/contrib/tag-doc"
target="generate-reports" inheritAll="false"/>
<mkdir dir="${dist.home}/contrib/tag-doc"/>
<copy todir="${dist.home}/contrib/tag-doc">
<fileset dir="${basedir}/contrib/tag-doc/target"/>
</copy>
</target>
<!--
Create directories and copy files for distribution
-->
<target name="prepare.dist" depends="init">
<mkdir dir="${dist.home}"/>
<mkdir dir="${dist.home}/lib"/>
<mkdir dir="${dist.home}/webapps"/>
</target>
<!--
Construct library distributables
-->
<target name="dist.library" depends="prepare.dist,compile.library">
<copy todir="${dist.home}/lib">
<fileset dir="${build.home}/library" includes="*.dtd"/>
<fileset dir="${build.home}/library" includes="*.jar"/>
<fileset dir="${build.home}/library" includes="*.tld"/>
<fileset dir="${build.home}/library" includes="*.xml"/>
</copy>
</target>
<!--
Construct distributable web applications
-->
<target name="dist.webapps" depends="compile.webapps,compile.javadoc">
<ant antfile="build-webapps.xml" target="dist"/>
</target>
<!--
Copy sources for distribution
-->
<target name="dist.source" depends="prepare.dist">
<copy file="INSTALL" tofile="${dist.home}/INSTALL"/>
<copy file="LICENSE.txt" tofile="${dist.home}/LICENSE"/>
<copy file="NOTICE.txt" tofile="${dist.home}/NOTICE"/>
<copy file="README" tofile="${dist.home}/README"/>
</target>
<!--
Build the contrib modules that are packaged with the binary
-->
<target name="dist.contrib" depends="dist.source" if="jstl.jar">
<mkdir dir="${dist.home}/contrib"/>
<!-- The STRUTS-EL Tag Library -->
<ant dir="${struts.el.home}"
target="clean" inheritAll="false"/>
<ant dir="${struts.el.home}"
target="dist" inheritAll="false"/>
<mkdir dir="${dist.home}/contrib/el"/>
<copy todir="${dist.home}/contrib/el">
<fileset dir="${struts.el.home}/dist"/>
</copy>
</target>
<!--
Build the example standalone modules (even though not yet included)
-->
<target name="dist.examples" depends="dist.library">
<!-- The Mail Reader Database APIs -->
<ant dir="${basedir}/struts-examples/mailreader"
target="clean" inheritAll="false"/>
<ant dir="${basedir}/struts-examples/mailreader"
target="dist" inheritAll="false"/>
</target>
<!--
Construct complete binary distribution
-->
<target name="dist"
depends="dist.library,dist.webapps,dist.source,dist.contrib,dist.examples"
description="Construct binary distribution"/>
<!--
Construct the nightly build
-->
<target name="nightly">
<tstamp>
<format property="TODAY" pattern="yyyyMMdd" locale="en"/>
</tstamp>
<antcall target="release">
<param name="upload.file.base" value="${project.name}-SNAPSHOT-${TODAY}"/>
</antcall>
</target>
<!--
Construct complete release distributions
-->
<target name="release" depends="clean,dist"
description="Construct release distribution">
<mkdir dir="${stage.bin.dir}/${upload.file.base}-bin"/>
<mkdir dir="${stage.lib.dir}/${upload.file.base}-lib"/>
<mkdir dir="${stage.src.dir}/${upload.file.base}-src"/>
<copy todir="${stage.bin.dir}/${upload.file.base}-bin">
<fileset dir="${dist.home}"/>
</copy>
<copy todir="${stage.lib.dir}/${upload.file.base}-lib">
<fileset dir="${dist.home}" includes="LICENSE NOTICE"/>
<fileset dir="${dist.home}/lib"/>
</copy>
<copy todir="${stage.src.dir}/${upload.file.base}-src">
<fileset dir=".">
<exclude name="build.properties"/>
<exclude name="target/**"/>
<exclude name="dist/**"/>
<exclude name="release/**"/>
<exclude name="lib/**"/>
<exclude name="contrib/el/dist/**"/>
<exclude name="contrib/el/target/**"/>
</fileset>
</copy>
<mkdir dir="${upload.dir}"/>
<zip zipfile="${upload.dir}/${upload.file.base}-bin.zip"
basedir="${stage.bin.dir}"/>
<zip zipfile="${upload.dir}/${upload.file.base}-lib.zip"
basedir="${stage.lib.dir}"/>
<zip zipfile="${upload.dir}/${upload.file.base}-src.zip"
basedir="${stage.src.dir}"/>
<tar tarfile="${upload.dir}/${upload.file.base}-bin.tar"
basedir="${stage.bin.dir}"
longfile="gnu"/>
<tar tarfile="${upload.dir}/${upload.file.base}-lib.tar"
basedir="${stage.lib.dir}"
longfile="gnu"/>
<tar tarfile="${upload.dir}/${upload.file.base}-src.tar"
basedir="${stage.src.dir}"
longfile="gnu"/>
<gzip src="${upload.dir}/${upload.file.base}-bin.tar"
zipfile="${upload.dir}/${upload.file.base}-bin.tar.gz"/>
<gzip src="${upload.dir}/${upload.file.base}-lib.tar"
zipfile="${upload.dir}/${upload.file.base}-lib.tar.gz"/>
<gzip src="${upload.dir}/${upload.file.base}-src.tar"
zipfile="${upload.dir}/${upload.file.base}-src.tar.gz"/>
<delete>
<fileset dir="${upload.dir}" includes="*.tar"/>
</delete>
<checksum algorithm="MD5" fileext=".md5">
<fileset dir="${upload.dir}" includes="*.zip,*.gz"/>
</checksum>
</target>
<!--
Deploy these applications on Catalina
-->
<target name="deploy.catalina" depends="compile.webapps"
description="Deploy Struts web.apps in Catalina (Tomcat 4.0)">
<mkdir dir="${catalina.home}/webapps/struts-blank"/>
<copy todir="${catalina.home}/webapps/struts-blank">
<fileset dir="${build.home}/blank"/>
</copy>
<mkdir dir="${catalina.home}/webapps/struts-documentation"/>
<copy todir="${catalina.home}/webapps/struts-documentation">
<fileset dir="${build.home}/documentation"/>
</copy>
<mkdir dir="${catalina.home}/webapps/struts-example"/>
<copy todir="${catalina.home}/webapps/struts-example">
<fileset dir="${build.home}/example"/>
</copy>
<mkdir dir="${catalina.home}/webapps/struts-examples"/>
<copy todir="${catalina.home}/webapps/struts-examples">
<fileset dir="${build.home}/examples"/>
</copy>
</target>
<!--
Dynamic struts-documentation management on Catalina (Tomcat 4.1.x required)
-->
<target name="install.documentation" depends="compile.webapps"
description="Dynamically install struts-documentation on Catalina (Tomcat 4.1)">
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
<install url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-documentation"
war="file://${build.home}/documentation"/>
</target>
<target name="reload.documentation" depends="compile.webapps"
description="Dynamically reload struts-documentation on Catalina (Tomcat 4.1)">
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<reload url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-documentation"/>
</target>
<target name="remove.documentation"
description="Dynamically remove struts-documentation on Catalina (Tomcat 4.1)">
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>
<remove url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-documentation"/>
</target>
<!--
Dynamic struts-example management on Catalina (Tomcat 4.1.x required)
-->
<target name="install.example" depends="compile.webapps"
description="Dynamically install struts-example on Catalina (Tomcat 4.1)">
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
<install url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-example"
war="file://${build.home}/example"/>
</target>
<target name="list.catalina"
description="Dynamically list installed apps on Catalina (Tomcat 4.1)">
<taskdef name="list" classname="org.apache.catalina.ant.ListTask"/>
<list url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}"/>
</target>
<target name="reload.example" depends="compile.webapps"
description="Dynamically reload struts-example on Catalina (Tomcat 4.1)">
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<reload url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-example"/>
</target>
<target name="remove.example"
description="Dynamically remove struts-example on Catalina (Tomcat 4.1)">
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>
<remove url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-example"/>
</target>
<!-- Backwards Compatibility -->
<target name="install.catalina" depends="install.example"/>
<target name="reload.catalina" depends="reload.example"/>
<target name="remove.catalina" depends="remove.example"/>
<!--
Dynamic struts-exercise management on Catalina (Tomcat 4.1.x required)
-->
<target name="install.exercise" depends="compile.webapps"
description="Dynamically install struts-exercise on Catalina (Tomcat 4.1)">
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
<install url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-exercise"
war="file://${build.home}/exercise-taglib"/>
</target>
<target name="reload.exercise" depends="compile.webapps"
description="Dynamically reload struts-exercise on Catalina (Tomcat 4.1)">
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<reload url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-exercise"/>
</target>
<target name="remove.exercise"
description="Dynamically remove struts-exercise on Catalina (Tomcat 4.1)">
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>
<remove url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-exercise"/>
</target>
<!--
Dynamic struts-tiles management on Catalina (Tomcat 4.1.x required)
-->
<target name="install.tiles" depends="compile.webapps"
description="Dynamically install struts-tiles on Catalina (Tomcat 4.1)">
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
<install url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-tiles"
war="file://${build.home}/tiles-documentation"/>
</target>
<target name="reload.tiles" depends="compile.webapps"
description="Dynamically reload struts-tiles on Catalina (Tomcat 4.1)">
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<reload url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-tiles"/>
</target>
<target name="remove.tiles"
description="Dynamically remove struts-tiles on Catalina (Tomcat 4.1)">
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>
<remove url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-tiles"/>
</target>
<!--
Dynamic struts-upload management on Catalina (Tomcat 4.1.x required)
-->
<target name="install.upload" depends="compile.webapps"
description="Dynamically install struts-upload on Catalina (Tomcat 4.1)">
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
<install url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-upload"
war="file://${build.home}/upload"/>
</target>
<target name="reload.upload" depends="compile.webapps"
description="Dynamically reload struts-upload on Catalina (Tomcat 4.1)">
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<reload url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-upload"/>
</target>
<target name="remove.upload"
description="Dynamically remove struts-upload on Catalina (Tomcat 4.1)">
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>
<remove url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-upload"/>
</target>
<!--
Dynamic struts-tiles management on Catalina (Tomcat 4.1.x required)
-->
<target name="install.validator" depends="compile.webapps"
description="Dynamically install struts-validator on Catalina (Tomcat 4.1)">
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
<install url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-validator"
war="file://${build.home}/validator"/>
</target>
<target name="reload.validator" depends="compile.webapps"
description="Dynamically reload struts-validator on Catalina (Tomcat 4.1)">
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<reload url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-validator"/>
</target>
<target name="remove.validator"
description="Dynamically remove struts-validator on Catalina (Tomcat 4.1)">
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>
<remove url="${catalina.url}" username="${catalina.username}"
password="${catalina.password}" path="/struts-validator"/>
</target>
<!--
Deploy these applications on Tomcat
-->
<target name="deploy.tomcat" depends="compile.webapps"
description="Deploy Struts web.apps in Tomcat 3.x">
<mkdir dir="${tomcat.home}/webapps/struts-blank"/>
<copy todir="${tomcat.home}/webapps/struts-blank">
<fileset dir="${build.home}/blank"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-documentation"/>
<copy todir="${tomcat.home}/webapps/struts-documentation">
<fileset dir="${build.home}/documentation"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-example"/>
<copy todir="${tomcat.home}/webapps/struts-example">
<fileset dir="${build.home}/example"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-exercise-taglib"/>
<copy todir="${tomcat.home}/webapps/struts-exercise-taglib">
<fileset dir="${build.home}/exercise-taglib"/>
</copy>
<mkdir dir="${tomcat.home}/webapps/struts-upload"/>
<copy todir="${tomcat.home}/webapps/struts-upload">
<fileset dir="${build.home}/upload"/>
</copy>
</target>
<!--
Clean contrib distribution
-->
<target name="clean.contrib" >
<ant dir="${struts.el.home}"
target="clean" inheritAll="false"/>
</target>
<!--
Clean up build and distribution directories
-->
<target name="clean" depends="clean.contrib"
description="Clean build and distribution directories">
<delete dir="${build.home}"/>
<delete dir="${dist.home}"/>
<delete dir="${release.home}"/>
<ant dir="${basedir}/struts-examples/mailreader"
target="clean" inheritAll="false"/>
</target>
<!--
Clean up build and distribution directories, then remove the downloaded dependencies directory
-->
<target name="clean-lib" depends="clean"
description="Clean the downloaded libs (you only run this if you also use 'download-dependencies' target)">
<delete dir="${libdir}"/>
</target>
<!--
All-in-one build target
-->
<target name="all" depends="clean,compile.library,compile.webapps"
description="Clean and build library and web applications"/>
<!--
Source code analysis targets
-->
<target name="checkstyle" if="checkstyle.jar"
description="Checks source code against Sun coding guidelines"
depends="init">
<taskdef name="checkstyle"
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath location="${checkstyle.jar}"/>
</taskdef>
<checkstyle>
<formatter type="plain"/>
<fileset dir="${src.share.dir}" includes="**/*.java"/>
</checkstyle>
</target>
<target name="pmd" if="pmd.home"
description="Locates unused imports, unused variables, etc."
depends="init">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
<classpath refid="pmd.classpath"/>
</taskdef>
<pmd printToConsole="true" rulesetfiles="${pmd.rulesets}" shortFilenames="true">
<formatter type="html" toFile="${pmd.report}" />
<fileset dir="${src.share.dir}" includes="**/*.java"/>
</pmd>
</target>
<target name="findbugs" if="findbugs.home"
description="Detects bugs using well-known patterns"
depends="init">
<taskdef name="findbugs"
classname="edu.umd.cs.findbugs.anttask.FindBugsTask" >
<classpath location="${findbugs.home}/lib/findbugs-ant.jar"/>
</taskdef>
<findbugs home="${findbugs.home}"
output="xml"
outputFile="${build.home}/findbugs.xml">
<class location="${build.home}/library/classes"/>
<auxClasspath>
<path refid="compile.classpath"/>
</auxClasspath>
<sourcePath path="${src.share.dir}"/>
</findbugs>
</target>
<!--
Compile Website documenation
-->
<target name="clean.website" depends="clean,compile.website"/>
<target name="compile.website"
description="Compile main website">
<ant antfile="build-webapps.xml" target="compile.docs"/>
<ant antfile="build-webapps.xml" target="validate.docs"/>
</target>
<!--
Run tests on all servers not commented out in the build.properties file.
-->
<!-- =================== Cactus-Based Tests on Tomcat ================= -->
<target name="test.tomcat.all"
depends="skip.tomcat.32,test.tomcat.32,
skip.tomcat.33,test.tomcat.33,
skip.tomcat.40,test.tomcat.40,
skip.tomcat.41,test.tomcat.41"
description="Run Cactus-based unit tests on all servlet engines">
</target>
<target name="skip.tomcat.32" unless="tomcat.home.32">
<echo message="*****************************************************"/>
<echo message="WARNING : Property 'tomcat.home.32' has not been set."/>
<echo message=" No test will be run on that servlet engine."/>
<echo message="*****************************************************"/>
<echo message=""/>
</target>
<target name="test.tomcat.32" if="tomcat.home.32"
depends="skip.tomcat.32,compile.library"
description="Run Cactus-based unit tests on Tomcat 3.2">
<echo message="tomcat.home.32 = ${tomcat.home.32}"/>
<ant antfile="build-tests.xml" target="test.tomcat.32"/>
<echo message="test.tomcat.32 complete using ${cactus.home}"/>
</target>
<target name="skip.tomcat.33" unless="tomcat.home.33">
<echo message="*****************************************************"/>
<echo message="WARNING : Property 'tomcat.home.33' has not been set."/>
<echo message=" No test will be run on that servlet engine."/>
<echo message="*****************************************************"/>
<echo message=""/>