/
build.xml
2014 lines (1567 loc) · 67.8 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
<?xml version="1.0"?>
<!--
Build file for the Spring Framework.
This script requires a "lib" directory containing the necessary third party JAR files.
See "project.properties" for the definitions of the properties used in this file.
Building Spring requires JDK 1.5+; the releases are built with Sun's JDK 1.5.0.
The test suite is able to run on JDK 1.4 and 1.3 as well.
Note: To successfully run the tests on JDK < 1.5.0, you need to use Xerces or any
other JAXP parser that properly supports XML includes. A simple way to achieve this
is to put xml-apis.jar and xercesImpl.jar into your "JAVA_HOME/jre/lib/ext" directory.
-->
<project name="spring-core" default="usage" basedir=".">
<property file="build.properties"/>
<property file="project.properties"/>
<property name="test.fork.mode" value="perBatch"/>
<!--
Set up properties that indicate whether we're building on JDK 1.5.
Currently simply checks whether the Java version is not 1.3 or 1.4,
due to the lack of a greater-than comparator in Ant.
-->
<condition property="tiger.available">
<not>
<or>
<equals arg1="${ant.java.version}" arg2="1.3"/>
<equals arg1="${ant.java.version}" arg2="1.4"/>
</or>
</not>
</condition>
<condition property="aspectj.available">
<and>
<istrue value="${tiger.available}"/>
<available file="${lib.dir}/aspectj/aspectjtools.jar"/>
</and>
</condition>
<path id="all-libs">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
<exclude name="aspectj/aspectjtools.jar"/>
</fileset>
</path>
<path id="attribute-compiler-classpath">
<fileset dir="lib/jakarta-commons">
<include name="commons-attributes-compiler.jar"/>
<include name="commons-collections.jar"/>
</fileset>
<fileset dir="lib/qdox">
<include name="qdox-1.5.jar"/>
</fileset>
</path>
<target name="usage">
<echo message=""/>
<echo message="Spring Framework build script"/>
<echo message="-----------------------------------------"/>
<echo message=""/>
<echo message="Among the available targets are:"/>
<echo message=""/>
<echo message="build --> build all; don't create JARs"/>
<echo message="alljars --> create all JAR files"/>
<echo message="tests --> run tests"/>
<echo message=""/>
</target>
<target name="clean" description="Clean all output dirs (dist, javadocs, classes, test-classes, etc)">
<delete dir="${target.classes.dir}"/>
<delete dir="${target.mockclasses.dir}"/>
<delete dir="${target.testclasses.dir}"/>
<delete dir="${target.tigertestclasses.dir}"/>
<delete dir="${target.clover.dir}"/>
<delete dir="${target.junit.reports.dir}"/>
<delete dir="${target.junit.summary.dir}"/>
<delete dir="${target.release.dir}"/>
<delete dir="${target.otherclasses.dir}"/>
<!-- Just kill target dir (it's safer). No need at this point to keep it. -->
<delete dir="${target.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${javadoc.dir}"/>
</target>
<target name="compileattr" description="Apply Commons Attributes compiler to main source files">
<!-- Bring in Jakarta Commons attribute compilation -->
<taskdef resource="org/apache/commons/attributes/anttasks.properties">
<classpath refid="attribute-compiler-classpath"/>
</taskdef>
<!-- Compile to a temp directory: Commons Attributes will place Java sources here -->
<attribute-compiler destdir="${commons.attributes.tempdir.src}">
<!--
Only the PathMap attribute in the org.springframework.web.servlet.handler.metadata
package currently needs to be shipped with an attribute, to support indexing.
-->
<fileset dir="${src.dir}" includes="**/metadata/*.java"/>
</attribute-compiler>
</target>
<!--
Compile the main source tree.
This task depends on the Commons Attributes compile step,
as some classes must ship with attributes.
-->
<target name="buildmain" depends="compileattr" description="Compile main source files">
<mkdir dir="${target.classes.dir}"/>
<mkdir dir="${target.classes.dir}/META-INF"/>
<javac destdir="${target.classes.dir}" source="1.3" target="1.3" debug="${debug}"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<!-- Include Commons Attributes generated Java sources -->
<src path="${commons.attributes.tempdir.src}"/>
<classpath refid="all-libs"/>
</javac>
<rmic base="${target.classes.dir}" classname="org.springframework.remoting.rmi.RmiInvocationWrapper"/>
<rmic base="${target.classes.dir}" classname="org.springframework.remoting.rmi.RmiInvocationWrapper" iiop="true">
<classpath refid="all-libs"/>
</rmic>
<copy todir="${target.classes.dir}" preservelastmodified="true">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
<include name="**/*.handlers"/>
<include name="**/*.schemas"/>
<include name="**/*.xml"/>
<include name="**/*.dtd"/>
<include name="**/*.xsd"/>
<include name="**/*.vm"/>
<include name="**/*.ftl"/>
<include name="**/*.types"/>
</fileset>
</copy>
<copy todir="${target.classes.dir}/META-INF" preservelastmodified="true">
<fileset dir="${src.dir}/org/springframework/web/servlet/tags">
<include name="*.tld"/>
</fileset>
<fileset dir="${src.dir}/org/springframework/web/servlet/tags/form">
<include name="*.tld"/>
</fileset>
</copy>
</target>
<!--
Compile the JDK 1.5 source tree.
-->
<target name="buildtiger" depends="buildmain" description="Compile JDK 1.5 source files">
<javac destdir="${target.classes.dir}" source="1.5" target="1.5" debug="${debug}"
deprecation="false" optimize="false" failonerror="true">
<src path="${tiger.src.dir}"/>
<classpath refid="all-libs"/>
</javac>
</target>
<!--
Compile the AspectJ source tree.
-->
<target name="buildaspects" depends="buildmain" if="aspectj.available" description="Compile AspectJ source files">
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
<classpath>
<pathelement location="${lib.dir}/aspectj/aspectjtools.jar"/>
</classpath>
</taskdef>
<iajc sourceroots="${aspectj.src.dir}" source="1.5" target="1.5" destDir="${target.classes.dir}">
<classpath>
<path refid="all-libs"/>
<path location="${target.classes.dir}"/>
</classpath>
</iajc>
<copy todir="${target.classes.dir}/META-INF" preservelastmodified="true">
<fileset dir="${aspectj.src.dir}/META-INF">
<include name="aop.xml"/>
</fileset>
</copy>
</target>
<!--
Compile the main, JDK 1.5, and AspectJ source trees.
-->
<target name="build" depends="buildmain,buildtiger,buildaspects" description="Compile all Spring source files"/>
<target name="initdist" description="Initialize the distribution directory">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/modules"/>
<mkdir dir="${dist.dir}/weavers"/>
<mkdir dir="${dist.dir}/resources"/>
</target>
<target name="fulljar" depends="build,initdist" description="Create full JAR file with all Spring classes">
<delete file="${dist.dir}/spring.jar"/>
<jar jarfile="${dist.dir}/spring.jar">
<fileset dir="${target.classes.dir}">
<include name="META-INF/**"/>
<include name="org/springframework/**"/>
<!-- exclude content of spring-aspects.jar -->
<exclude name="META-INF/aop.xml"/>
<exclude name="org/springframework/beans/factory/aspectj/**"/>
<exclude name="org/springframework/transaction/aspectj/**"/>
<exclude name="org/springframework/orm/hibernate/**"/>
<exclude name="org/springframework/web/portlet/**"/>
</fileset>
<zipfileset src="lib/aopalliance/aopalliance.jar"/>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
<!-- Allow use of this JAR as a Java agent -->
<attribute name="Premain-Class" value="org.springframework.instrument.InstrumentationSavingAgent" />
</manifest>
</jar>
</target>
<target name="modulejars" depends="build,initdist" description="Create module-specific JAR files">
<delete>
<fileset dir="${dist.dir}">
<include name="modules/*.jar"/>
</fileset>
</delete>
<jar jarfile="${dist.dir}/modules/spring-core.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/core/**"/>
<include name="org/springframework/util/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-beans.jar">
<fileset dir="${target.classes.dir}">
<include name="META-INF/*.handlers"/>
<include name="META-INF/*.schemas"/>
<include name="org/springframework/beans/**"/>
<!-- exclude content of spring-aspects.jar -->
<exclude name="org/springframework/beans/factory/aspectj/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-aop.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/aop/**"/>
<include name="org/springframework/metadata/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-context.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/context/**"/>
<!-- exclude content of spring-tomcat-weaver.jar -->
<include name="org/springframework/instrument/classloading/**"/>
<exclude name="org/springframework/instrument/classloading/oc4j/**"/>
<exclude name="org/springframework/instrument/classloading/tomcat/**"/>
<include name="org/springframework/jndi/**"/>
<include name="org/springframework/scheduling/**"/>
<exclude name="org/springframework/scheduling/quartz/**"/>
<include name="org/springframework/stereotype/**"/>
<include name="org/springframework/ui/**"/>
<exclude name="org/springframework/ui/velocity/**"/>
<exclude name="org/springframework/ui/freemarker/**"/>
<exclude name="org/springframework/ui/jasperreports/**"/>
<include name="org/springframework/validation/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-dao.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/dao/**"/>
<include name="org/springframework/transaction/**"/>
<!-- exclude content of spring-aspects.jar -->
<exclude name="org/springframework/transaction/aspectj/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-jdbc.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/jdbc/**"/>
<include name="org/springframework/orm/**"/>
<exclude name="org/springframework/orm/hibernate/**"/>
<exclude name="org/springframework/orm/hibernate3/**"/>
<exclude name="org/springframework/orm/ibatis/**"/>
<exclude name="org/springframework/orm/jdo/**"/>
<exclude name="org/springframework/orm/jpa/**"/>
<exclude name="org/springframework/orm/toplink/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-support.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/cache/**"/>
<include name="org/springframework/instrument/classloading/oc4j/**"/>
<include name="org/springframework/mail/**"/>
<include name="org/springframework/scheduling/quartz/**"/>
<include name="org/springframework/scripting/**"/>
<include name="org/springframework/ui/velocity/**"/>
<include name="org/springframework/ui/freemarker/**"/>
<include name="org/springframework/ui/jasperreports/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-web.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/web/**"/>
<exclude name="org/springframework/web/servlet/**"/>
<exclude name="org/springframework/web/portlet/**"/>
<exclude name="org/springframework/web/struts/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-webmvc.jar">
<fileset dir="${target.classes.dir}">
<include name="META-INF/*.tld"/>
<include name="org/springframework/web/servlet/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-portlet.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/web/portlet/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-struts.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/web/struts/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-remoting.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/ejb/**"/>
<include name="org/springframework/remoting/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-jmx.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/jmx/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-jms.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/jms/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-jca.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/jca/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-jdo.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/orm/jdo/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-jpa.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/orm/jpa/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-hibernate2.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/orm/hibernate/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-hibernate3.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/orm/hibernate3/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-toplink.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/orm/toplink/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/modules/spring-ibatis.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/orm/ibatis/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
</target>
<target name="aspectjar" depends="build,initdist" description="Create aspect JAR file (containing AspectJ aspects)">
<delete file="${dist.dir}/spring-aspects.jar"/>
<jar jarfile="${dist.dir}/spring-aspects.jar">
<fileset dir="${target.classes.dir}">
<include name="META-INF/aop.xml"/>
<include name="org/springframework/beans/factory/aspectj/**"/>
<include name="org/springframework/transaction/aspectj/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
</target>
<target name="weaverjars" depends="build,initdist" description="Create weaver JAR files (for specific platforms)">
<delete>
<fileset dir="${dist.dir}">
<include name="weavers/*.jar"/>
</fileset>
</delete>
<jar jarfile="${dist.dir}/weavers/spring-agent.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/instrument/InstrumentationSavingAgent.class"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
<attribute name="Premain-Class" value="org.springframework.instrument.InstrumentationSavingAgent"/>
</manifest>
</jar>
<jar jarfile="${dist.dir}/weavers/spring-tomcat-weaver.jar">
<fileset dir="${target.classes.dir}">
<include name="org/springframework/instrument/classloading/WeavingTransformer.class"/>
<include name="org/springframework/instrument/classloading/tomcat/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
</target>
<target name="buildmainmock" depends="build" description="Compile mock source files">
<mkdir dir="${target.mockclasses.dir}"/>
<javac destdir="${target.mockclasses.dir}" source="1.3" target="1.3" debug="${debug}"
deprecation="false" optimize="false" failonerror="true">
<src path="${mock.dir}"/>
<classpath refid="all-libs"/>
<classpath location="${target.classes.dir}"/>
</javac>
<!-- Pick up logging config from test directory -->
<copy todir="${target.mockclasses.dir}" preservelastmodified="true">
<fileset dir="${mock.dir}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
<target name="buildtigermock" depends="buildmainmock" description="Compile tiger mock source files">
<mkdir dir="${target.mockclasses.dir}"/>
<javac destdir="${target.mockclasses.dir}" source="1.5" target="1.5" debug="${debug}"
deprecation="false" optimize="false" failonerror="true">
<src path="${tiger.mock.dir}"/>
<classpath refid="all-libs"/>
<classpath location="${target.classes.dir}"/>
</javac>
<!-- Pick up logging config from test directory -->
<copy todir="${target.mockclasses.dir}" preservelastmodified="true">
<fileset dir="${tiger.mock.dir}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
<target name="buildmock" depends="buildmainmock,buildtigermock" description="Compile all mock source files"/>
<target name="mockjar" depends="buildmock,initdist" description="Create JAR file with Spring mock classes">
<delete file="${dist.dir}/spring-mock.jar"/>
<jar jarfile="${dist.dir}/spring-mock.jar">
<fileset dir="${target.mockclasses.dir}">
<include name="META-INF/**"/>
<include name="org/springframework/**"/>
</fileset>
<manifest>
<attribute name="Implementation-Title" value="${spring-title}"/>
<attribute name="Implementation-Version" value="${spring-version}"/>
<attribute name="Spring-Version" value="${spring-version}"/>
</manifest>
</jar>
</target>
<target name="srczip" depends="initdist" description="Create source ZIP (containing Java sources)">
<delete file="${dist.dir}/spring-src.zip"/>
<zip zipfile="${dist.dir}/spring-src.zip">
<fileset dir="${src.dir}">
<include name="org/springframework/**"/>
</fileset>
<fileset dir="${tiger.src.dir}">
<include name="org/springframework/**"/>
</fileset>
<fileset dir="${aspectj.src.dir}">
<include name="org/springframework/**"/>
</fileset>
<fileset dir="${mock.dir}">
<include name="org/springframework/**"/>
</fileset>
<fileset dir="${tiger.mock.dir}">
<include name="org/springframework/**"/>
</fileset>
</zip>
</target>
<target name="distfiles" depends="initdist" description="Copy dtd, tld and suchlike to the dist directory">
<copy file="${src.dir}/org/springframework/beans/factory/xml/spring-beans.dtd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/beans/factory/xml/spring-beans-2.0.dtd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/beans/factory/xml/spring-beans-2.0.xsd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/beans/factory/xml/spring-tool-2.0.xsd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/beans/factory/xml/spring-util-2.0.xsd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/aop/config/spring-aop-2.0.xsd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/ejb/config/spring-jee-2.0.xsd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/scripting/config/spring-lang-2.0.xsd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/transaction/config/spring-tx-2.0.xsd"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/web/servlet/tags/spring.tld"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/web/servlet/tags/form/spring-form.tld"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/web/servlet/view/velocity/spring.vm"
todir="${dist.dir}/resources" preservelastmodified="true"/>
<copy file="${src.dir}/org/springframework/web/servlet/view/freemarker/spring.ftl"
todir="${dist.dir}/resources" preservelastmodified="true"/>
</target>
<target name="alljars" depends="fulljar,modulejars,aspectjar,weaverjars,mockjar,srczip"
description="Create all JAR files"/>
<!--
Convenience targets, needed for the automated build process. Convenience targets are
made up of the individual targets called, separated by an underscore.
-->
<target name="clean_alljars" depends="clean, alljars"/>
<!--
Generate javadoc for the main and JDK 1.5 sources.
-->
<target name="javadoc" description="Generate framework Javadocs">
<delete dir="${javadoc.dir}" failonerror="false"/>
<mkdir dir="${javadoc.dir}"/>
<javadoc sourcepath="${src.dir}" destdir="${javadoc.dir}" windowtitle="Spring Framework API 2.0"
source="1.5" access="protected" author="true" version="true" use="true"
defaultexcludes="true" stylesheetfile="${doc.dir}/stylesheet.css"
overview="${doc.dir}/overview.html"
header='<a href=\"http://www.springframework.org/\" target=\"_top\">The Spring Framework</a>'>
<arg value="-breakiterator"/>
<arg value="-J-Xmx128m"/>
<arg value="-J-XX:MaxPermSize=128m"/>
<arg value="-J-Dhttp.proxyHost=${javadoc.proxyhost}"/>
<arg value="-J-Dhttp.proxyPort=${javadoc.proxyport}"/>
<doctitle><![CDATA[<h1>Spring Framework API 2.0</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2002-2007 <a href="http://www.springframework.org/" target="_top">The Spring Framework</a>.</i>]]></bottom>
<classpath refid="all-libs"/>
<packageset dir="${src.dir}">
<include name="org/springframework/**"/>
</packageset>
<packageset dir="${mock.dir}">
<include name="org/springframework/**"/>
</packageset>
<packageset dir="${tiger.src.dir}">
<include name="org/springframework/**"/>
</packageset>
<packageset dir="${tiger.mock.dir}">
<include name="org/springframework/**"/>
</packageset>
<link href="http://java.sun.com/j2ee/1.4/docs/api"/>
<link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
<link href="http://aopalliance.sourceforge.net/doc"/>
<!-- Caucho Burlap/Hessian -->
<link href="http://cglib.sourceforge.net/apidocs"/>
<!-- COS -->
<!-- EasyMock -->
<link href="http://ehcache.sourceforge.net/apidocs"/>
<link href="http://freemarker.sourceforge.net/docs/api/"/>
<link href="http://www.hibernate.org/hib_docs/v3/api"/>
<!-- iBATIS -->
<!-- iText -->
<!-- Commons Attributes -->
<link href="http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/"/>
<link href="http://jakarta.apache.org/commons/dbcp/apidocs/"/>
<link href="http://jakarta.apache.org/commons/fileupload/apidocs/"/>
<link href="http://jakarta.apache.org/commons/httpclient/apidocs/"/>
<link href="http://jakarta.apache.org/commons/logging/apidocs/"/>
<link href="http://jakarta.apache.org/commons/pool/apidocs/"/>
<!-- JasperReports -->
<!-- JDO -->
<!-- JMX -->
<!-- JOTM -->
<!-- JPA -->
<!-- JSF -->
<link href="http://junit.sourceforge.net/javadoc/"/>
<link href="http://logging.apache.org/log4j/docs/api/"/>
<link href="http://jakarta.apache.org/regexp/apidocs/"/>
<link href="http://jakarta.apache.org/poi/apidocs/"/>
<link href="http://portals.apache.org/pluto/multiproject/portlet-api/apidocs/"/>
<link href="http://quartz.sourceforge.net/javadoc/"/>
<link href="http://struts.apache.org/struts-doc-1.2.9/api/"/>
<link href="http://jakarta.apache.org/velocity/api/"/>
</javadoc>
</target>
<target name="compiletestattr" description="Apply Commons Attributes compiler to test source files">
<taskdef resource="org/apache/commons/attributes/anttasks.properties">
<classpath refid="attribute-compiler-classpath"/>
</taskdef>
<!-- Compile to a temp directory: Commons Attributes will place Java sources here -->
<attribute-compiler destdir="${commons.attributes.tempdir.test}">
<fileset dir="${test.dir}" includes="org/springframework/aop/**/*.java"/>
<fileset dir="${test.dir}" includes="org/springframework/jmx/**/*.java"/>
</attribute-compiler>
</target>
<target name="compileallattrs" depends="compileattr,compiletestattr"/>
<!--
Compile the main test tree.
This task depends on the Commons Attributes compile step,
as some tests require source-level attribute support.
-->
<target name="buildmaintests" depends="buildmock,compiletestattr" description="Compile test source files">
<mkdir dir="${target.testclasses.dir}"/>
<javac destdir="${target.testclasses.dir}" source="1.3" target="1.3" debug="${debug}"
deprecation="false" optimize="false" failonerror="true">
<src path="${test.dir}"/>
<!-- Include Commons Attributes generated Java sources -->
<src path="${commons.attributes.tempdir.test}"/>
<classpath refid="all-libs"/>
<classpath location="${target.classes.dir}"/>
<classpath location="${target.mockclasses.dir}"/>
</javac>
<!-- Pick up config files from test directory -->
<copy todir="${target.testclasses.dir}" preservelastmodified="true">
<fileset dir="${test.dir}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/*.types"/>
</fileset>
</copy>
</target>
<target name="buildtigertests" depends="buildmaintests" description="Compile JDK 1.5 test source files">
<mkdir dir="${target.tigertestclasses.dir}"/>
<javac destdir="${target.tigertestclasses.dir}" source="1.5" target="1.5" debug="${debug}"
deprecation="false" optimize="false" failonerror="true">
<src path="${tiger.test.dir}"/>
<classpath refid="all-libs"/>
<classpath location="${target.classes.dir}"/>
<classpath location="${target.mockclasses.dir}"/>
<classpath location="${target.testclasses.dir}"/>
</javac>
<!-- Pick up config files from test directory -->
<copy todir="${target.tigertestclasses.dir}" preservelastmodified="true">
<fileset dir="${tiger.test.dir}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
<include name="**/*.jar"/>
<include name="**/*.sql"/>
</fileset>
</copy>
</target>
<target name="buildaspecttests" depends="buildmaintests" if="aspectj.available"
description="Compile AspectJ test source files">
<mkdir dir="${target.tigertestclasses.dir}"/>
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
<classpath>
<pathelement location="${lib.dir}/aspectj/aspectjtools.jar"/>
</classpath>
</taskdef>
<!-- Note that this actually recompiles the aspects in the
aspectj source tree too, so that the test classes get
woven. It would be nicer to depend on a pre-built jar,
but that's a bigger change and there aren't many aspects
so the overhead here is negligible.
TODO: create spring-aspects.jar as an independent target.
Have this task depend on it (and also modulejars).
Then we can switch to just putting spring-aspects.jar
on the aspectpath and avoid the recompilation -->
<iajc sourceroots="${aspectj.test.dir}:${aspectj.src.dir}"
source="1.5" target="1.5" destDir="${target.tigertestclasses.dir}">
<classpath>
<path refid="all-libs"/>
<path location="${target.classes.dir}"/>
<path location="${target.mockclasses.dir}"/>
<path location="${target.testclasses.dir}"/>
<path location="${target.tigertestclasses.dir}"/>
</classpath>
</iajc>
<!-- Pick up config files from test directory -->
<copy todir="${target.tigertestclasses.dir}" preservelastmodified="true">
<fileset dir="${aspectj.test.dir}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</target>
<target name="buildtests" depends="buildmaintests,buildtigertests,buildaspecttests"
description="Compile main, JDK 1.5, and AspectJ test sources"/>
<target name="maintests" description="Run main tests">
<mkdir dir="${target.junit.reports.dir}"/>
<junit dir="${basedir}" forkmode="perBatch" printsummary="yes" haltonfailure="yes" haltonerror="yes">
<jvmarg line="-Djava.awt.headless=true -Xmx256m -XX:MaxPermSize=128m"/>
<!-- Must go first to ensure any jndi.properties files etc take precedence -->
<classpath location="${target.testclasses.dir}"/>
<classpath location="${target.mockclasses.dir}"/>
<classpath location="${target.classes.dir}"/>
<!-- Need files loaded as resources -->
<classpath location="${test.dir}"/>
<classpath refid="all-libs"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes" todir="${target.junit.reports.dir}">
<fileset dir="${target.testclasses.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
</batchtest>
</junit>
</target>
<target name="tigertests" if="tiger.available" description="Run JDK 1.5 tests">
<mkdir dir="${target.junit.reports.dir}"/>
<junit dir="${basedir}" forkmode="perBatch" printsummary="yes" haltonfailure="yes" haltonerror="yes">
<jvmarg line="-Djava.awt.headless=true -Xmx256m -XX:MaxPermSize=128m"/>
<!-- Must go first to ensure any jndi.properties files etc take precedence -->
<classpath location="${target.tigertestclasses.dir}"/>
<classpath location="${target.testclasses.dir}"/>
<classpath location="${target.mockclasses.dir}"/>
<classpath location="${target.classes.dir}"/>
<!-- Need files loaded as resources -->
<classpath location="${test.dir}"/>
<classpath refid="all-libs"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes" todir="${target.junit.reports.dir}">
<fileset dir="${target.tigertestclasses.dir}" includes="${test.includes}" excludes="${test.excludes}"/>
</batchtest>
</junit>
</target>
<!--
Run test suite. This and clover.tests take their includes and excludes from
"build.properties". However it's possible to run specific tests by passing in
the "test.includes" and (optionally) "test.excludes" properties through the
command line, as below: