-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
887 lines (727 loc) · 33 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
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
and Distribution License("CDDL") (collectively, the "License"). You
may not use this file except in compliance with the License. You can
obtain a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
or packager/legal/LICENSE.txt. See the License for the specific
language governing permissions and limitations under the License.
When distributing the software, include this License Header Notice in each
file and include the License file at packager/legal/LICENSE.txt.
GPL Classpath Exception:
Oracle designates this particular file as subject to the "Classpath"
exception as provided by Oracle in the GPL Version 2 section of the License
file that accompanied this code.
Modifications:
If applicable, add the following below the License Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyright [year] [name of copyright owner]"
Contributor(s):
If you wish your version of this file to be governed by only the CDDL or
only the GPL Version 2, indicate your decision by adding "[Contributor]
elects to include this software in this distribution under the [CDDL or GPL
Version 2] license." If you don't indicate a single choice of license, a
recipient has the option to distribute your version of this file under
either the CDDL, the GPL Version 2 or to extend the choice of license to
its licensees as provided above. However, if you add GPL Version 2 code
and therefore, elected the GPL Version 2 license, then the option applies
only if the new code is made subject to such option by the copyright
holder.
-->
<project name="SAAJ Reference Implementation" default="wspack" basedir=".">
<!-- ************ What the heck are we building ************************** -->
<property name="name" value="SAAJ RI"/>
<property name="version" value="1.3.4"/>
<property name="api.version" value="1.3.1"/>
<property name="suffix" value=""/>
<property name="rpm.version" value="1.3.4"/>
<property name="rpm.release" value="1"/>
<property name="zip.release" value="1"/>
<!-- ************ Per user local properties ****************************** -->
<property file="${user.home}/build.properties"/> <!-- User local -->
<property file="build.properties"/> <!-- Component local -->
<property file="../build.properties"/> <!-- Commons local -->
<!-- ************ Where are we building into? **************************** -->
<!-- The base directory for compilation targets -->
<property name="build.home" value="${basedir}/build"/>
<!-- The base directory for the saaj APIs -->
<property name="saaj.api.home" value ="../jaxm-api/"/>
<!-- The directory into which saaj APIs are built -->
<property name="saaj.api.build.home" value="${saaj.api.home}/build"/>
<!-- The base directory for component sources -->
<property name="source.home" value="${basedir}/src/java"/>
<!-- The base directory for dependent jars -->
<property name="lib.home" value="${basedir}/lib"/>
<!-- The base directory for samples -->
<property name="samples.home" value="${basedir}/samples"/>
<!-- The base directory for tools -->
<property name="tools.home" value="${basedir}/tools"/>
<!-- The base directory for unit test sources -->
<property name="test.home" value="src/test"/>
<!-- The home directory for Ant -->
<property name="ant.home" value="${basedir}/lib"/>
<!-- what goes into wspack -->
<property name="wspack.home" value="${basedir}/wspack-test"/>
<!-- The base directory for distribution targets -->
<property name="dist.home" value="${basedir}/dist"/>
<!-- The package name -->
<property name="pkg.saaj" value="SUNWxsrt"/>
<!-- The package product name -->
<property name="pkg.prod.name" value="Sun Java(TM) Enterprise System"/>
<!-- The package product version -->
<property name="pkg.prod.version" value="5.0"/>
<!-- The package build directory -->
<property name="pkg.build.dir" value="${build.home}/pkg"/>
<!-- The package distribution directory -->
<property name="pkg.release.dir" value="${basedir}/pkg-dist"/>
<!-- The rpm build directory -->
<property name="rpm.build.dir" value="${build.home}/rpm/SAAJ"/>
<!-- The rpm distribution directory -->
<property name="rpm.release.dir" value="${basedir}/rpm-dist"/>
<!-- The zip file build directory -->
<property name="zip.build.dir" value="${build.home}/zip"/>
<!-- The zip file distribution directory -->
<property name="zip.release.dir" value="${basedir}/zip-dist"/>
<!-- The hpux build directory -->
<property name="hpux.build.dir" value="${build.home}/hpux"/>
<!-- The hpux distribution directory -->
<property name="hpux.release.dir" value="${basedir}/hpux-dist"/>
<!-- ************ Dependencies **** ************************************** -->
<!-- The locations of necessary jar files -->
<property name="jaf.jar" value="${lib.home}/activation.jar"/>
<property name="servlet.jar" value="${lib.home}/servlet.jar"/>
<property name="qname.jar" value="${lib.home}/jax-qname.jar"/>
<property name="saaj.jar" value="${lib.home}/saaj-api.jar"/>
<property name="FastInfoset.jar" value="${lib.home}/FastInfoset.jar"/>
<property name="mimepull.jar" value="${lib.home}/mimepull.jar"/>
<property name="xerces.jar" value="${lib.home}/xerces.jar"/>
<!-- ************ Compiler Defaults ************************************** -->
<!-- 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="true"/>
<!-- Should Java compilations set the 'optimize' compiler option? -->
<property name="compile.optimize" value="true"/>
<!-- Construct compile classpath -->
<path id="compile.classpath">
<pathelement location="${build.home}/classes"/>
<pathelement location="${jaf.jar}"/>
<pathelement location="${servlet.jar}"/>
<pathelement location="${saaj.jar}"/>
<pathelement location="${qname.jar}"/>
<pathelement location="${FastInfoset.jar}"/>
<pathelement location="${mimepull.jar}"/>
<pathelement location="${xerces.jar}"/>
</path>
<property name="junit.jar" value="${lib.home}/junit.jar"/>
<path id="test.classpath">
<pathelement location="${build.home}/classes" />
<pathelement location="${build.home}/test/classes" />
<pathelement location="${qname.jar}"/>
<pathelement location="${xerces.jar}"/>
<pathelement location="${junit.jar}"/>
<path refid="compile.classpath" />
<pathelement path="${java.class.path}"/>
</path>
<path id="test.classpath.jdk">
<pathelement location="${build.home}/test/classes" />
<pathelement location="${junit.jar}"/>
<pathelement path="${java.class.path}"/>
<pathelement location="${xerces.jar}"/>
</path>
<!-- ========== Executable Targets ======================================== -->
<target name="init"
description="Initialize and evaluate conditionals">
<echo message="-------- Building ${name} ${version} --------"/>
</target>
<target name="prepare" depends="init"
description="Prepare build directory">
<mkdir dir="${build.home}"/>
<mkdir dir="${build.home}/classes"/>
<mkdir dir="${build.home}/docs"/>
<mkdir dir="${build.home}/lib"/>
<mkdir dir="${build.home}/tests"/>
<copy todir="${build.home}/classes">
<fileset dir="${source.home}" includes="**/*.properties"/>
</copy>
</target>
<target name="compile" depends="prepare"
description="Just compile the classes">
<!-- Run javac through everything -->
<javac srcdir="${source.home}"
destdir="${build.home}/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="compile.classpath"/>
</javac>
<!-- Copy default Factories info -->
<copy todir="${build.home}/classes/META-INF/services">
<fileset dir="${basedir}/etc/" includes="javax.xml.soap.*"/>
</copy>
</target>
<target name="jar" depends="image"
description="Commonly used target name. Alias for 'image'."/>
<target name="image" depends="compile, prepare"
description="Build into build.home">
<!-- Copy resource files etc -->
<copy todir="${build.home}/classes" filtering="on">
<fileset dir="${source.home}" excludes="**/*.java"/>
</copy>
<!-- Copy dependent jars -->
<copy todir="${build.home}/lib">
<fileset dir="${lib.home}/"
includes="**/*.jar"
excludes="servlet.jar, ant.jar, optional.jar"/>
</copy>
<tstamp>
<format pattern="yyyy-MM-dd" property="TODAY.ISO"/>
</tstamp>
<filter token="today.iso" value="${TODAY.ISO}"/>
<jar jarfile="${build.home}/lib/saaj-impl.jar"
basedir="${build.home}/classes">
<manifest>
<attribute name="Specification-Title" value="SOAP with Attachments API for Java"/>
<attribute name="Specification-Version" value="${api.version}"/>
<attribute name="Implementation-Title" value="SAAJ Implementation"/>
<attribute name="Implementation-Version" value="${version}${suffix}"/>
<attribute name="Implementation-Vendor" value="Sun Microsystems Inc"/>
<attribute name="Implementation-Vendor-Id" value="com.sun"/>
<attribute name="Build-Id" value="${build.number}-${TODAY.ISO}"/>
<attribute name="Extension-Name" value="com.sun.xml.messaging.saaj"/>
<attribute name="Class-Path" value="saaj-api.jar activation.jar"/>
</manifest>
</jar>
</target>
<target name="wspack" depends="wspack-specific, image, wspackdocs">
<mkdir dir="${wspack.home}"/>
<mkdir dir="${wspack.home}/webapps"/>
<mkdir dir="${wspack.home}/samples"/>
<copy file="${build.home}/lib/saaj-api.jar"
todir="${wspack.home}/lib/"/>
<copy file="${build.home}/lib/saaj-impl.jar"
todir="${wspack.home}/lib/"/>
<copy todir="${wspack.home}/docs/">
<fileset dir="${build.home}/docs" excludes="api/**"/>
</copy>
<ant dir="${basedir}/samples"/>
<copy todir="${wspack.home}/webapps">
<fileset dir="${dist.home}/samples" includes="*.war" />
</copy>
<copy todir="${wspack.home}/samples">
<fileset dir="${build.home}/samples" excludes="**/*run*"
includes="uddiping/**" />
<fileset dir="${build.home}/samples"
includes="soapprocessor/lib/**" />
<fileset dir="${basedir}/samples"
includes="soapprocessor/**"
excludes="soapprocessor/build.xml"/>
</copy>
<copy file="${build.home}/samples/uddiping/run-wspack.sh"
tofile="${wspack.home}/samples/uddiping/run.sh" overwrite="yes"/>
<copy file="${build.home}/samples/uddiping/run-wspack.bat"
tofile="${wspack.home}/samples/uddiping/run.bat" overwrite="yes"/>
<!-- progress sample application -->
<copy todir="${wspack.home}/samples">
<fileset dir="${build.home}/samples" excludes="**/*run*"
includes="progress/**" />
</copy>
<copy file="${build.home}/samples/progress/run-wspack-client.sh"
tofile="${wspack.home}/samples/progress/run-client.sh" overwrite="yes"/>
<copy file="${build.home}/samples/progress/run-wspack-client.bat"
tofile="${wspack.home}/samples/progress/run-client.bat" overwrite="yes"/>
<copy file="${build.home}/samples/progress/run-wspack-server.sh"
tofile="${wspack.home}/samples/progress/run-server.sh" overwrite="yes"/>
<copy file="${build.home}/samples/progress/run-wspack-server.bat"
tofile="${wspack.home}/samples/progress/run-server.bat" overwrite="yes"/>
</target>
<target name="wspackdocs" depends="prepare">
<copy todir="${wspack.home}/docs/">
<fileset dir="${basedir}/docs" />
</copy>
<mkdir dir="${wspack.home}/samples/soapprocessor/javadocs"/>
<!-- create Javadocs for SOAPProcessor -->
<javadoc packagenames="com.sun.xml.soap"
sourcepath="${basedir}/samples/soapprocessor/src"
destdir="${wspack.home}/samples/soapprocessor/javadocs"
author="false"
version="false"
windowtitle="${Name} ${version}${suffix}"
doctitle="${Name} ${version}${suffix}"
bottom="Copyright © 2004 Sun Microsystems, Inc. All Rights Reserved.">
<classpath refid="compile.classpath"/>
</javadoc>
</target>
<target name="wspack-specific" depends="prepare">
<!-- do not copy the sources
<mkdir dir="${wspack.home}/src/"/>
<copy todir="${wspack.home}/src" overwrite="yes">
<fileset dir="src/java/"/>
</copy>
-->
</target>
<target name="compile-tests" depends="image">
<mkdir dir="${build.home}/test/classes"/>
<javac srcdir="${test.home}"
destdir="${build.home}/test/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
includeJavaRuntime="yes">
<include name="**/*.java" />
<classpath refid="test.classpath" />
</javac>
<!-- Make the tests jar -->
<jar jarfile="${build.home}/test/saaj-tests.jar"
basedir="${build.home}/test/classes">
</jar>
</target>
<target name="compile-tests-jdk" depends="image">
<mkdir dir="${build.home}/test/classes"/>
<javac srcdir="${test.home}"
destdir="${build.home}/test/classes"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
includeJavaRuntime="yes">
<include name="**/*.java" />
<exclude name="saajhttpget/**"/>
<classpath refid="test.classpath.jdk" />
</javac>
<!-- Make the tests jar -->
<jar jarfile="${build.home}/test/saaj-tests.jar"
basedir="${build.home}/test/classes">
</jar>
</target>
<target name="copy-test-resources">
<copy todir="${build.home}/test/classes">
<fileset dir="${test.home}">
<include name="resources/"/>
</fileset>
</copy>
</target>
<target name="prepare-tests" depends="compile-tests, copy-test-resources"/>
<target name="prepare-tests-jdk" depends="compile-tests-jdk, copy-test-resources"/>
<target name="run-tests" depends="prepare-tests">
<junit printsummary="no" haltonfailure="yes" fork="true">
<classpath refid="test.classpath"/>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${build.home}/test/classes">
<include name="**/AllTests.class" />
</fileset>
</batchtest>
</junit>
<junit printsummary="no" haltonfailure="yes" fork="true">
<jvmarg value="-Dsaaj.mime.optimization=false"/>
<classpath refid="test.classpath"/>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${build.home}/test/classes">
<include name="**/AllTests.class" />
</fileset>
</batchtest>
</junit>
</target>
<!-- run tests with SecurityManager ON, uses a policy file test.policy -->
<target name="run-tests-sm" depends="prepare-tests">
<junit printsummary="no" haltonfailure="yes" fork="true">
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=./src/test/test.policy"/>
<classpath refid="test.classpath"/>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${build.home}/test/classes">
<!--include name="bugfixes/SAAJConnectionTest.class" /-->
<include name="**/AllTests.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="runtests-with-jdk" depends="prepare-tests-jdk">
<junit printsummary="yes" haltonfailure="yes" fork="true">
<classpath refid="test.classpath.jdk"/>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${build.home}/test/classes">
<include name="**/AllTests.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="run-single-test" if="testcase" depends="prepare-tests"
description="Use -Dtestcase=bugfixes.BugfixesTest on command line">
<junit printsummary="no" haltonfailure="no" fork="true">
<classpath refid="test.classpath"/>
<formatter type="brief" usefile="false" />
<test name="${testcase}" />
</junit>
</target>
<target name="run-test" depends="test-1"/>
<target name="test-all" depends="prepare-tests"
description="Runs all regression tests that should pass. Result
of tests can be easily verified.">
<java classname="junit.textui.TestRunner" fork="yes">
<jvmarg value="-Dsaaj.run.only.AllTests"/>
<arg value="util.AllTests2"/>
<classpath refid="test.classpath"/>
</java>
</target>
<target name="test-1" depends="prepare-tests"
description="Run a single subset of tests. Feel free to change
the actual test that gets run by this target as needed.">
<java classname="bugfixes.BugfixesTest" fork="yes">
<jvmarg value="-Dsaaj.debug=1"/>
<classpath refid="test.classpath"/>
</java>
</target>
<target name="print-cp">
<property refid="test.classpath" name="cp.prop"/>
<echo>cp= ${cp.prop}</echo>
</target>
<target name="clean"
description="Clean build and distribution directories">
<delete dir="${build.home}"/>
<delete dir="${wspack.home}"/>
<delete dir="${dist.home}"/>
<delete dir="${pkg.release.dir}"/>
<delete dir="${rpm.release.dir}"/>
<delete dir="${zip.release.dir}"/>
<delete dir="${basedir}/j2se-integration" />
<delete dir="${basedir}/remove-rename" />
</target>
<target name="all" depends="clean, compile"
description="Clean and compile all components"/>
<target name="dist" depends="image">
<mkdir dir="${dist.home}"/>
<mkdir dir="${dist.home}/lib"/>
<mkdir dir="${dist.home}/samples"/>
<mkdir dir="${dist.home}/docs"/>
<copy todir="${dist.home}/lib">
<fileset dir="${build.home}/lib" excludes="servlet.jar, ant.jar"/>
</copy>
<ant dir="${basedir}/samples"/>
<copy todir="${dist.home}/samples">
<fileset dir="${build.home}/samples" >
<include name="*.war" />
</fileset>
</copy>
<copy todir="${dist.home}/docs">
<fileset dir="${build.home}/docs"/>
</copy>
</target>
<!-- SAAJ package creation -->
<!-- assumes the dist target has been called -->
<target name="create.pkg" description="Create SAAJ package">
<!-- copy pkginfo.tmpl to pkginfo in build dir and replace variables -->
<copy tofile="${pkg.build.dir}/${pkg.saaj}/pkginfo" file="${basedir}/pkg/${pkg.saaj}/pkginfo.tmpl"
overwrite="yes"/>
<replace file="${pkg.build.dir}/${pkg.saaj}/pkginfo" value="all">
<replacetoken>@arch@</replacetoken>
</replace>
<!-- replace date stamp... 1st specify correct format -->
<tstamp>
<format property="pkg.datestamp" pattern="yyyy.MM.dd.hh.mm"/>
</tstamp>
<replace file="${pkg.build.dir}/${pkg.saaj}/pkginfo" value="${pkg.datestamp}">
<replacetoken>@datestamp@</replacetoken>
</replace>
<!-- replace saaj version -->
<replace file="${pkg.build.dir}/${pkg.saaj}/pkginfo" value="${version}${suffix}">
<replacetoken>@saaj.version@</replacetoken>
</replace>
<!-- replace product version -->
<replace file="${pkg.build.dir}/${pkg.saaj}/pkginfo" value="${pkg.prod.version}">
<replacetoken>@prod.version@</replacetoken>
</replace>
<!-- replace product name -->
<replace file="${pkg.build.dir}/${pkg.saaj}/pkginfo" value="${pkg.prod.name}">
<replacetoken>@prod.name@</replacetoken>
</replace>
<!-- copy prototype, depend, and copyright files -->
<copy todir="${pkg.build.dir}/${pkg.saaj}" overwrite="yes">
<fileset dir="${basedir}/pkg/${pkg.saaj}">
<include name="prototype*"/>
<include name="depend"/>
<include name="copyright"/>
</fileset>
</copy>
<!-- copy saaj jar files into the right directory structure -->
<copy todir="${pkg.build.dir}/${pkg.saaj}/usr/share/lib" overwrite="yes">
<fileset dir="${dist.home}/lib">
<include name="saaj-*.jar"/>
</fileset>
</copy>
<!-- make output directory -->
<mkdir dir="${pkg.release.dir}"/>
<!-- run pkgmk -f prototype_sparc -d tmp_dir -o PKGNAME -->
<exec executable="pkgmk" failonerror="true"
dir="${pkg.build.dir}/${pkg.saaj}">
<arg value="-f"/>
<arg value="prototype_sparc"/>
<arg value="-d"/>
<arg value="${pkg.release.dir}"/>
<arg value="-r"/>
<arg value="."/>
<arg value="-o"/>
<arg value="${pkg.saaj}"/>
</exec>
</target>
<!-- SAAJ rpm creation -->
<!-- assumes the dist target has been called -->
<target name="create.rpm" description="Create SAAJ RPM">
<!-- assign prefix of where files will be installed on system -->
<property name="rpm.install.base" value="/opt/sun"/>
<!-- make sure this directory is initially clean -->
<delete dir="${rpm.build.dir}/SOURCES"/>
<!-- Create build subdirectories -->
<mkdir dir="${rpm.build.dir}/BUILD"/>
<mkdir dir="${rpm.build.dir}/RPMS"/>
<mkdir dir="${rpm.build.dir}/SOURCES"/>
<mkdir dir="${rpm.build.dir}/SPECS"/>
<mkdir dir="${rpm.build.dir}/SRPMS"/>
<!-- copy template spec file to spec file in build dir and replace variables
-->
<copy tofile="${rpm.build.dir}/SPECS/SAAJ.spec" file="${basedir}/rpm/SAAJ.spec.tmpl"
overwrite="yes"/>
<!-- replace saaj version -->
<replace file="${rpm.build.dir}/SPECS/SAAJ.spec" value="${rpm.version}">
<replacetoken>@saaj.version@</replacetoken>
</replace>
<!-- replace saaj release -->
<replace file="${rpm.build.dir}/SPECS/SAAJ.spec" value="${rpm.release}">
<replacetoken>@saaj.release@</replacetoken>
</replace>
<!-- replace product name -->
<replace file="${rpm.build.dir}/SPECS/SAAJ.spec" value="${pkg.prod.name}">
<replacetoken>@prod.name@</replacetoken>
</replace>
<!-- if the product name is blank then remove this field from the spec file
-->
<replace file="${rpm.build.dir}/SPECS/SAAJ.spec" value="">
<replacetoken>Distribution: </replacetoken>
</replace>
<!-- replace build dir -->
<replace file="${rpm.build.dir}/SPECS/SAAJ.spec" value="${rpm.build.dir}">
<replacetoken>@build.dir@</replacetoken>
</replace>
<!-- replace prefix value -->
<replace file="${rpm.build.dir}/SPECS/SAAJ.spec" value="${rpm.install.base}">
<replacetoken>@install.prefix@</replacetoken>
</replace>
<!-- copy saaj jar files into the right directory structure, but first
make sure this directory is empty -->
<copy todir="${rpm.build.dir}/SOURCES/sun-saaj-${rpm.version}${rpm.install.base}/share/lib" overwrite="yes">
<fileset dir="${dist.home}/lib">
<include name="saaj-*.jar"/>
</fileset>
</copy>
<!-- compress saaj files -->
<tar destfile="${rpm.build.dir}/SOURCES/sun-saaj-${rpm.version}.tar" basedir="${rpm.build.dir}/SOURCES"/>
<!-- build rpm -->
<exec executable="rpmbuild" failonerror="true"
dir="${rpm.build.dir}">
<arg value="-bb"/>
<arg value="SPECS/SAAJ.spec"/>
</exec>
<!-- make output directory -->
<mkdir dir="${rpm.release.dir}"/>
<!-- copy rpm to dist directory -->
<copy todir="${rpm.release.dir}">
<fileset dir="${rpm.build.dir}/RPMS"/>
</copy>
</target>
<!-- SAAJ zip file distribution creation -->
<!-- assumes the dist target has been called -->
<target name="create.zip" description="Create SAAJ zip file distribution">
<echo message="-------- Extracting MimePull classes to ${build.home}/classes --------"/>
<exec dir="${build.home}/classes" executable="jar" >
<arg line="xvf ${lib.home}/mimepull.jar"/>
</exec>
<echo message="-------- Adding MimePull classes to saaj-impl.jar--------"/>
<jar jarfile="${build.home}/lib/saaj-impl.jar"
basedir="${build.home}/classes"
index="false"
update="true"
excludes="com/**, META-INF/**">
</jar>
<!-- make build and output directories -->
<mkdir dir="${zip.build.dir}"/>
<mkdir dir="${zip.release.dir}"/>
<!-- copy saaj jar files into the right directory structure -->
<copy todir="${zip.build.dir}/saaj/lib" overwrite="yes">
<fileset dir="${build.home}/lib">
<include name="saaj-*.jar"/>
</fileset>
</copy>
<copy todir="${zip.build.dir}" overwrite="yes">
<fileset dir="${basedir}/zip">
<include name="filelist.txt"/>
<include name="version"/>
</fileset>
</copy>
<copy todir="${zip.build.dir}" overwrite="yes">
<fileset dir="${basedir}">
<include name="license.html"/>
</fileset>
</copy>
<!-- replace parameters in version file -->
<replace file="${zip.build.dir}/version" value="${version}${suffix}">
<replacetoken>@saaj.version@</replacetoken>
</replace>
<!-- replace date stamp... 1st specify correct format -->
<tstamp>
<format property="pkg.datestamp" pattern="yyyyMMdd"/>
</tstamp>
<replace file="${zip.build.dir}/version" value="${pkg.datestamp}">
<replacetoken>@datestamp@</replacetoken>
</replace>
<replace file="${zip.build.dir}/version" value="${zip.release}">
<replacetoken>@zip.release@</replacetoken>
</replace>
<!-- make zip file -->
<zip destfile="${zip.release.dir}/saaj.zip" basedir="${zip.build.dir}" whenempty="fail"/>
</target>
<!-- =======================
HPUX FILE DISTRIBUTION
======================= -->
<!-- assumes the dist target has been called -->
<target name="create.hpux" description="Create SAAJ HPUX package">
<!-- copy template spec file to spec file in build dir and replace variables -->
<copy tofile="${hpux.build.dir}/sun-saaj.psf" file="${basedir}/hpux/sun-saaj.psf.tmpl" overwrite="yes"/>
<!-- replace saaj version -->
<replace file="${hpux.build.dir}/sun-saaj.psf" value="${version}${suffix}">
<replacetoken>@saaj.version@</replacetoken>
</replace>
<!-- replace date stamp... 1st specify correct format -->
<tstamp>
<format property="pkg.datestamp" pattern="yyyy.MM.dd.hh.mm"/>
</tstamp>
<replace file="${hpux.build.dir}/sun-saaj.psf" value="${pkg.datestamp}">
<replacetoken>@datestamp@</replacetoken>
</replace>
<!-- replace bindir, libdir -->
<replace file="${hpux.build.dir}/sun-saaj.psf" value="${basedir}/hpux">
<replacetoken>@bindir@</replacetoken>
</replace>
<mkdir dir="${hpux.build.dir}/lib"/>
<copy todir="${hpux.build.dir}/lib" overwrite="yes">
<fileset dir="${dist.home}/lib">
<include name="saaj-api.jar"/>
<include name="saaj-impl.jar"/>
</fileset>
</copy>
<replace file="${hpux.build.dir}/sun-saaj.psf" value="${hpux.build.dir}/lib">
<replacetoken>@libdir@</replacetoken>
</replace>
<!-- make output directory -->
<mkdir dir="${hpux.release.dir}/sun-saaj"/>
<exec executable="/usr/sbin/swpackage" failonerror="true">
<arg line="-x follow_symlinks=true -x compression_type=gzip -x compress_cmd=/usr/contrib/bin/gzip -x uncompress_files=false -x compress_files=true -x reinstall_files=true -x package_in_place=false -x target_type=directory -x write_remote_files=true -x run_as_superuser=false -s ${hpux.build.dir}/sun-saaj.psf @ ${hpux.release.dir}/sun-saaj"/>
</exec>
</target>
<target name="create.src.zip" description="Create SAAJ source zip file">
<mkdir dir="${zip.release.dir}"/>
<copy todir="${zip.release.dir}" overwrite="yes">
<fileset dir="${lib.home}">
<include name="saaj-api-src.zip"/>
</fileset>
</copy>
<zip destfile="${zip.release.dir}/saaj${version}${suffix}.src.zip" basedir="${source.home}" />
</target>
<target name="copytotck" description="Run the SAAJ TCK tests">
<property file="${basedir}/tckprops/tck.properties"/>
<echo> "Copying SAAJ specific build.properties" </echo>
<copyfile src="${basedir}/tckprops/saajtck.properties" dest="${saajtck.home}/bin/build.properties"/>
<copyfile src="${saajtck.home}/lib/tsharness.jar" dest="${jwsdp.home}/common/lib/tsharness.jar"/>
<copyfile src="${saajtck.home}/lib/saajtck.jar" dest="${jwsdp.home}/common/lib/saajtck.jar"/>
</target>
<target name="runtck" depends="dist" description="Run the SAAJ TCK tests">
<echo> "TCK tests running...." </echo>
<copyfile src="${basedir}/build/lib/saaj-impl.jar" dest="${jwsdp.home}/saaj/lib/saaj-impl.jar"/>
<copyfile src="${basedir}/build/lib/saaj-api.jar" dest="${jwsdp.home}/saaj/lib/saaj-api.jar"/>
<property file="${basedir}/tckprops/tck.properties"/>
<ant dir="${saajtck.home}/bin" target="clean" >
</ant>
<ant dir="${saajtck.home}/bin" target="build" >
<property name="user.dir" value="${saajtck.home}/src/com/sun/ts/tests/saaj"/>
</ant>
<ant dir="${saajtck.home}/bin" target="deploy" >
<property name="user.dir" value="${saajtck.home}/src/com/sun/ts/tests/saaj"/>
</ant>
<echo> "Starting Catalina ...." </echo>
<exec dir="${jwsdp.home}/bin" executable="${jwsdp.home}/bin/startup.bat" os="Windows 2000">
</exec>
<exec dir="${jwsdp.home}/bin" executable="${jwsdp.home}/bin/startup.sh" os="SunOS">
</exec>
<exec dir="${jwsdp.home}/bin" executable="${jwsdp.home}/bin/startup.sh" os="Linux">
</exec>
<echo> "Sleep for Catalina to Start...." </echo>
<sleep milliseconds="150000"/>
<ant dir="${saajtck.home}/bin" target="runclient" >
<property name="user.dir" value="${saajtck.home}/src/com/sun/ts/tests/saaj"/>
</ant>
<echo> "Stopping Catalina ...." </echo>
<exec dir="${jwsdp.home}/bin" executable="${jwsdp.home}/bin/shutdown.bat" os="Windows 2000">
</exec>
<exec dir="${jwsdp.home}/bin" executable="${jwsdp.home}/bin/shutdown.sh" os="SunOS">
</exec>
<exec dir="${jwsdp.home}/bin" executable="${jwsdp.home}/bin/shutdown.sh" os="Linux">
</exec>
</target>
<target name="debug-nb">
<nbjpdastart addressproperty="jpda.address" name="SAAJ Reference Implementation 2.0" transport="dt_socket">
<classpath refid="test.classpath"/>
</nbjpdastart>
<!-- TODO configure the main class for your project here: -->
<java classname="junit.ui.TestRunner" fork="true">
<classpath refid="test.classpath"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=none"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<arg value="mime.AttachImageTest"/>
</java>
</target>
<target name="integrate-package-rename-task">
<get src="http://kohsuke.sfbay.sun.com/hudson/job/package-rename-task/lastSuccessfulBuild/artifact/target/package-rename-task-1.0.jar"
dest="${basedir}/lib/package-rename-task.jar"/>
</target>
<target name="j2se-integration" description="prepare renamed source code for J2SE integration">
<taskdef name="prename" classname="com.sun.wts.tools.ant.PackageRenameTask">
<classpath>
<pathelement path="${basedir}/lib/package-rename-task.jar"/>
</classpath>
</taskdef>
<prename srcdir="src/java" destdir="j2se-integration/saaj-ri/src/java">
<pattern from="com.sun.xml" to="com.sun.xml.internal"/>
<pattern from="org.jvnet.fastinfoset" to="com.sun.xml.internal.org.jvnet.fastinfoset" />
<pattern from="org.jvnet.mimepull" to="com.sun.xml.internal.org.jvnet.mimepull" />
</prename>
<!-- sanity test -->
<mkdir dir="build/renamed-classes"/>
<javac srcdir="j2se-integration/saaj-ri/src/java" destdir="build/renamed-classes">
<classpath>
<fileset dir="lib" includes="*.jar"/>
</classpath>
</javac>
</target>
<target name="remove-rename" description="remove renaming to make saaj wore">
<taskdef name="prename" classname="com.sun.wts.tools.ant.PackageRenameTask">
<classpath>
<pathelement path="${basedir}/lib/package-rename-task.jar"/>
</classpath>
</taskdef>
<prename srcdir="src/java" destdir="remove-rename/saaj-ri/src/java">
<pattern from="com.sun.org.apache.xerces.internal" to="org.apache.xerces"/>
</prename>
<!-- sanity test -->
<mkdir dir="build/nonrenamed-classes"/>
<javac srcdir="remove-rename/saaj-ri/src/java" destdir="build/nonrenamed-classes" >
<classpath>
<fileset dir="lib" includes="*.jar"/>
</classpath>
</javac>
</target>
</project>