forked from mulderbaba/xmlsec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
783 lines (689 loc) · 29.5 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
<?xml version="1.0"?>
<project name="Apache Santuario" default="help" basedir=".">
<!-- G L O B A L P R O P E R T I E S -->
<!-- Product name and version properties -->
<property name="product.Name" value="Apache XML Security for Java"/>
<property name="product.name" value="xml-security"/>
<property name="product.shortname" value="xmlsec"/>
<property name="product.version.major" value="1"/>
<property name="product.version.minor" value="5"/>
<property name="product.version.level" value="8"/>
<property name='product.version.qualifier' value=''/>
<property name="product.version"
value="${product.version.major}.${product.version.minor}.${product.version.level}${product.version.qualifier}"/>
<property name="product_version"
value="${product.version.major}_${product.version.minor}_${product.version.level}${product.version.qualifier}"/>
<property name="year" value="2000-2014"/>
<property name="copyright"
value="Copyright © ${year} Apache XML Project. All Rights Reserved."/>
<!-- directory properties -->
<property name="dir.src" value="${basedir}/src/main/java" />
<property name="dir.src.test" value="${basedir}/src/test/java" />
<property name="dir.src.samples" value="${basedir}/samples" />
<property name="dir.libs" value="${basedir}/libs" />
<property name="dir.build" value="${basedir}/build" />
<property name="dir.build.bin" value="${dir.build}/classes" />
<property name="dir.build.libs" value="${dir.build}/libs" />
<property name="dir.build.test" value="${dir.build}/test" />
<property name="dir.build.samples" value="${dir.build}/samples" />
<property name="dir.build.docs" value="${dir.build}/docs" />
<property name="dir.build.docs.xml" value="${dir.build.docs}/xml" />
<property name="dir.build.docs.html" value="${dir.build.docs}/html" />
<property name="dir.build.src" value="${dir.build}/src" />
<property name="dir.build.dist" value="${dir.build}/dist" />
<property name="dir.build.srcdist" value="${dir.build.dist}/src/${product.name}-${product_version}"/>
<property name="dir.build.bindist" value="${dir.build.dist}/bin/${product.name}-${product_version}"/>
<property name="dir.build.junit.xml" value="${dir.build.docs.xml}/junit" />
<property name="dir.build.junit.html" value="${dir.build.docs.html}/junit" />
<property name="dir.build.javadoc" value="${dir.build.docs.html}/javadoc" />
<property name="dir.build.coverage" value="${dir.build.docs.html}/coverage" />
<property name="dir.manifest" value="${dir.build.bin}/META-INF"/>
<!-- library properties -->
<property name="lib.logging" value="${dir.libs}/commons-logging-1.1.1.jar" />
<property name="lib.log4j" value="${dir.libs}/log4j-1.2.16.jar" />
<property name="lib.xalan.1" value="${dir.libs}/xalan-2.7.2.jar" />
<property name="lib.xalan.2" value="${dir.libs}/serializer-2.7.2.jar" />
<property name="lib.xalan.3" value="${dir.libs}/xml-apis-1.3.04.jar" />
<property name="lib.xerces.1" value="${dir.libs}/xercesImpl-2.9.1.jar" />
<property name="lib.jce" value="${dir.libs}/${jce.provider.prefix}-${jce.provider.jar}" />
<property name="lib.junit" value="${dir.libs}/junit-4.8.2.jar" />
<property name="lib.clover" value="${dir.libs}/clover.jar" />
<!-- Apache Santuario libraries (for bin distribution) -->
<property name="lib.xmlsec" value="${dir.libs}/xmlsec-${product.version}.jar" />
<property name="lib.xmlsec.samples" value="${dir.libs}/xmlsecSamples-${product.version}.jar"/>
<property name="lib.xmlsec.tests" value="${dir.libs}/xmlsecTests-${product.version}.jar" />
<!-- JAR properties -->
<property name="jar.library" value="${dir.build}/xmlsec-${product.version}.jar" />
<property name="jar.samples" value="${dir.build}/xmlsecSamples-${product.version}.jar" />
<property name="jar.tests" value="${dir.build}/xmlsecTests-${product.version}.jar" />
<property name="jar.manifest" value="${dir.manifest}/MANIFEST.MF"/>
<!-- build variable properties -->
<!-- T A S K D E F S -->
<taskdef resource="clovertasks"/>
<!-- C O N D I T I O N A L P R O P E R T I E S -->
<target name="do.build.src" >
<!-- global properties applies here -->
</target >
<!-- P A T H S -->
<path id="id.classpath.xalan" >
<pathelement location="${lib.xalan.1}" />
<pathelement location="${lib.xalan.2}" />
<pathelement location="${lib.xalan.3}" />
</path >
<path id="id.classpath.xerces" >
<pathelement location="${lib.xerces.1}" />
</path >
<path id="id.classpath.logging" >
<pathelement location="${lib.logging}" />
<pathelement location="${lib.log4j}" />
</path >
<path id="id.classpath.common" >
<path refid="id.classpath.xalan" />
<path refid="id.classpath.xerces" />
<path refid="id.classpath.logging" />
</path >
<path id="id.classpath.crypt" >
<pathelement location="${lib.jce}" />
</path >
<path id="id.classpath.coverage" >
<pathelement location="${lib.clover}" />
</path >
<path id="id.classpath.sig" >
</path >
<path id="id.classpath" >
<path refid="id.classpath.common" />
<path refid="id.classpath.crypt" />
<path refid="id.classpath.sig" />
<!--path refid="id.classpath.coverage" /-->
</path >
<path id="id.classpath.test" >
<path refid="id.classpath" />
<pathelement path="${lib.junit}"/>
<pathelement location="${dir.build.bin}" />
<pathelement location="${dir.build.test}" />
<path refid="id.classpath.coverage" />
<pathelement location="${lib.xmlsec}" />
<pathelement location="${lib.xmlsec.samples}" />
<pathelement location="${lib.xmlsec.tests}" />
</path>
<path id="id.classpath.samples" >
<path refid="id.classpath" />
<pathelement location="${dir.build.bin}" />
<pathelement location="${dir.build.test}" />
<pathelement location="${dir.build.samples}" />
<pathelement location="${lib.xmlsec}" />
<pathelement location="${lib.xmlsec.samples}" />
<pathelement location="${lib.xmlsec.tests}" />
</path>
<!-- P A T T E R N S E T S -->
<patternset id="id.patternset.distFiles">
<include name="build.xml"/>
<include name="pom.xml"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
</patternset>
<patternset id="id.patternset.srcFiles">
<include name="src/**/*"/>
</patternset>
<patternset id="id.patternset.sampleFiles">
<include name="samples/**/*"/>
</patternset>
<!-- T A R G E T S -->
<!-- Welcome screen -->
<target name="init">
<echo message=""/>
<echo message="-------------------------------------------------------------------"/>
<echo message="--------- ${product.Name} v${product.version} [${year}] -----------"/>
<echo message="-------------------------------------------------------------------"/>
<echo message="Building with ${ant.version}"/>
<echo message="Java ${java.version} located at ${java.home} "/>
<echo message="-------------------------------------------------------------------"/>
<echo message=""/>
</target>
<!-- environment targets -->
<!-- set up -->
<target name="env.mk.dirs" depends="init" unless="has.dirs" >
<mkdir dir="${dir.build}" />
<mkdir dir="${dir.build.bin}" />
<mkdir dir="${dir.build.docs}" />
<mkdir dir="${dir.build.test}" />
<mkdir dir="${dir.build.libs}" />
<mkdir dir="${dir.build.dist}" />
<mkdir dir="${dir.build.samples}" />
<property name="has.dirs" value="true" />
</target >
<!-- tear down -->
<target depends="init" name="env.rm.dirs" >
<delete dir="${dir.build}" />
</target >
<target depends="init" name="env.rm.files" >
<delete file="signature.xml"/>
<delete file="axisSignature.xml"/>
<delete file="encryptedInfo.xml"/>
<delete file="decryptedInfo.xml"/>
<delete file="kek"/>
<delete>
<fileset dir="." includes="merlin16*.html,merlins*.xml" />
</delete>
</target >
<target depends="init" name="with.clover" >
<clover-setup initstring="clover-db/coverage.db" >
<fileset dir="${dir.src}" >
<include name="**/*.java" />
<exclude name="**/*Exception.java" />
</fileset >
</clover-setup >
</target >
<!-- check targets -->
<target name="do.check.bindist">
<condition property="is.bin.dist">
<and>
<available file="${lib.xmlsec}" />
<available file="${lib.xmlsec.samples}" />
<available file="${lib.xmlsec.tests}" />
<not>
<available type="dir" file="src" />
</not>
</and>
</condition>
</target>
<!-- B U I L D T A R G E T S -->
<property environment="env"/>
<!-- source -->
<target name="build.src"
depends="do.build.src,env.mk.dirs,do.check.bindist"
unless="is.bin.dist">
<javac target="1.5" source="1.5" srcdir="${dir.src}"
destdir="${dir.build.bin}"
debug="${build.compile.debug}"
includeAntRuntime="false">
<compilerarg value="-XDignore.symbol.file" />
<classpath refid="id.classpath" />
<include name="**/org/apache/xml/security/**/*.java" />
<include name="**/javax/xml/crypto/**/*.java" />
<include name="**/org/apache/jcp/xml/dsig/internal/**/*.java" />
</javac >
<copy todir="${dir.build.bin}" >
<fileset dir="${dir.src}"
includes="**/org/apache/xml/security/resource/*,
**/org/apache/xml/security/resource/schema/*"/>
</copy >
</target >
<!-- tests -->
<target name="build.test"
depends="build.src"
unless="is.bin.dist">
<javac target="1.5" source="1.5" srcdir="${dir.src.test}"
destdir="${dir.build.test}"
debug="${build.compile.debug}"
includeAntRuntime="false">
<classpath refid="id.classpath.test" />
<include name="**/org/apache/xml/security/**/*.java" />
<include name="**/javax/xml/crypto/**/*.java" />
</javac>
<copy todir="${dir.build.test}">
<fileset dir="${dir.src.test}" includes="**/*.properties"/>
<fileset dir="${dir.src.test}" includes="**/*.xml"/>
<fileset dir="${dir.src.test}" includes="**/*.zip"/>
</copy>
</target>
<!-- samples -->
<target name="build.samples"
depends="build.src"
unless="is.bin.dist">
<javac target="1.5" source="1.5" srcdir="${dir.src.samples}"
destdir="${dir.build.samples}"
debug="${build.compile.debug}"
includeAntRuntime="false">
<classpath refid="id.classpath.samples"/>
</javac>
<copy todir="${dir.build.samples}/data">
<fileset dir="${dir.src.samples}/data" includes="**/*.xml"/>
<fileset dir="${dir.src.samples}/data" includes="**/*.zip"/>
</copy>
</target>
<!-- T E S T T A R G E T S -->
<!-- big test -->
<target name="test" depends="build.jar"
description="Starts all Junit tests">
<delete dir="${dir.build.junit.xml}"/>
<delete dir="${dir.build.junit.html}"/>
<mkdir dir="${dir.build.junit.xml}"/>
<mkdir dir="${dir.build.junit.html}"/>
<!-- The unit tests include so-called interoperability tests against
cryptographic values generated using software from other vendors.
This package includes many of these vectors, but not the ones from
the IBM alphaWorks XML Security Suite. They are not included because
IBM even has these signatures under copyright.
If you want to test against IBM, download xss4j from
http://www.alphaworks.ibm.com/tech/xmlsecuritysuite
and put the files into the
src/test/resources/com/ibm/xss4j-20030127/
directory. If the file enveloped-rsa.sig is found in that directory,
IBM is 'magically' included in the test ;-))
-->
<available file="src/test/resources/com/ibm/xss4j-20030127/enveloped-rsa.sig" property="ibm.available"/>
<junit filtertrace="true" fork="true" printsummary="on"
failureproperty="build.test.failed">
<jvmarg value="-Djava.compiler=NONE"/>
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="proxyHost" value="${proxy.host}"/>
<sysproperty key="proxyPort" value="${proxy.port}"/>
<sysproperty key="java.util.logging.config.file"
value="${basedir}/logging.properties"/>
<sysproperty key="product.version" value="${product.version}"/>
<classpath refid="id.classpath.test"/>
<formatter type="xml"/>
<!-- Also put output to screen -->
<formatter type="plain" usefile="false"/>
<batchtest fork="yes" todir="${dir.build.junit.xml}">
<fileset dir="${dir.src.test}">
<include name="org/apache/xml/security/**/*Test.java"/>
</fileset>
</batchtest>
<test if="ibm.available" name="org.apache.xml.security.test.interop.IBMTest" todir="${dir.build.junit.xml}"/>
</junit>
<junitreport todir="${dir.build.junit.xml}">
<fileset dir="${dir.build.junit.xml}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dir.build.junit.html}"/>
</junitreport>
<fail if="build.test.failed" message="Unit Tests Failed"/>
</target>
<!-- Test JSR 105/XML DSig API -->
<target name="test_jsr105" depends="build.jar"
description="Runs JSR 105 interop and unit tests">
<delete dir="${dir.build.junit.xml}"/>
<delete dir="${dir.build.junit.html}"/>
<mkdir dir="${dir.build.junit.xml}"/>
<mkdir dir="${dir.build.junit.html}"/>
<junit filtertrace="true" fork="true" printsummary="on"
failureproperty="build.test.failed">
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="proxyHost" value="${proxy.host}"/>
<sysproperty key="proxyPort" value="${proxy.port}"/>
<sysproperty key="java.util.logging.config.file" value="${basedir}/logging.properties"/>
<classpath refid="id.classpath.test"/>
<formatter type="xml"/>
<!-- Also put output to screen -->
<formatter type="plain" usefile="false"/>
<batchtest fork="yes" todir="${dir.build.junit.xml}">
<fileset dir="${dir.src.test}">
<include name="javax/xml/crypto/**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${dir.build.junit.xml}">
<fileset dir="${dir.build.junit.xml}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dir.build.junit.html}"/>
</junitreport>
<fail if="build.test.failed" message="Unit Tests Failed"/>
</target>
<!-- Run all the tests -->
<target name="all-tests" depends="test,test_jsr105"
description="Runs all the test targets">
</target>
<!-- XML Encryption Samples -->
<target name="encrypt"
depends="build.samples"
description="encrypts xml data">
<delete file="build/encryptedInfo.xml"/>
<delete file="build/kek"/>
<java classname="org.apache.xml.security.samples.encryption.Encrypter"
failonerror="true"
fork="yes"
taskname="Encrypter">
<classpath refid="id.classpath.samples"/>
</java>
</target>
<target name="decrypt"
depends="build.samples"
description="decrypts xml data">
<delete file="build/decryptedInfo.xml"/>
<java classname="org.apache.xml.security.samples.encryption.Decrypter"
failonerror="true"
fork="yes"
taskname="Decrypter">
<classpath refid="id.classpath.samples"/>
</java>
</target>
<target name="encryptAndDecrypt"
depends="encrypt, decrypt"
description="encrypts and decrypts an element's contents" />
<!-- Signature Samples -->
<target name="sign"
depends="build.samples"
description="creates a signature" >
<delete file="build/signature.xml"/>
<java classname="org.apache.xml.security.samples.signature.CreateSignature"
failonerror="true"
fork="yes"
taskname="CreateSignature">
<classpath refid="id.classpath.samples"/>
</java>
</target>
<target name="verify"
depends="build.samples"
description="verifies a signature">
<java classname="org.apache.xml.security.samples.signature.VerifySignature"
failonerror="true"
fork="yes"
taskname="VerifySignature">
<classpath refid="id.classpath.samples"/>
</java>
</target>
<target name="signAndVerify"
depends="sign, verify"
description="creates and verifies a signature" />
<!-- Axis Signature Samples -->
<target name="axis-sign"
depends="build.samples"
description="axis sign sample">
<echo message="Running org.apache.xml.security.samples.AxisSigner"/>
<java classname="org.apache.xml.security.samples.AxisSigner"
failonerror="true" fork="yes" taskname="SignAxis">
<classpath refid="id.classpath.samples"/>
</java>
</target>
<target name="axis-verify"
depends="build.samples"
description="axis verify sample">
<echo message="Running org.apache.xml.security.samples.AxisVerifier"/>
<java classname="org.apache.xml.security.samples.AxisVerifier"
failonerror="true"
fork="yes"
taskname="VerifyAxis">
<classpath refid="id.classpath.samples"/>
</java>
</target>
<target depends="axis-sign, axis-verify" name="AxisSignAndVerify"/>
<!-- Mega Samples -->
<target name="mega-sample"
depends="build.samples">
<echo message="Now I'll try to verify merlins example fifteen-HMAC"/>
<java classname="org.apache.xml.security.samples.signature.VerifyMerlinsExamplesFifteen"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
<echo message=""/>
<echo message="Now I'll try to verify merlins example sixteen"/>
<java classname="org.apache.xml.security.samples.signature.VerifyMerlinsExamplesSixteen"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
<echo message=""/>
<echo message="Now I'll try to verify merlins example twenty three"/>
<java classname="org.apache.xml.security.samples.signature.VerifyMerlinsExamplesTwentyThree"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
<echo message=""/>
<echo message="Now I'll create a signature in signature.xml and verify it"/>
<java classname="org.apache.xml.security.samples.signature.CreateSignature"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
<java classname="org.apache.xml.security.samples.signature.VerifySignature"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
<echo message=""/>
<echo message="Now I'll create a signature like merlin-16 but without XSLT"/>
<java classname="org.apache.xml.security.samples.signature.CreateMerlinsExampleSixteen"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
<echo message=""/>
<echo message="Please look into log.txt, merlinsSixteenRecreated.xml and signature.xml"/>
<echo message=""/>
<echo message="Now I'll create a signature like merlin-23 but without XSLT"/>
<java classname="org.apache.xml.security.samples.signature.CreateMerlinsExampleTwentyThree"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
<echo message=""/>
<echo message="Please look into log.txt, merlinsTwentyThreeRecreated.xml and signature.xml"/>
</target>
<target name="createEnvelope"
depends="build.samples">
<java classname="org.apache.xml.security.samples.signature.CreateEnvelopingSignature"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
</target>
<!-- JSR 105 Samples -->
<target name="jsr105-samples"
depends="build.samples">
<echo message="Generating a detached signature"/>
<java classname="javax.xml.crypto.dsig.samples.GenDetached"
fork="yes">
<classpath refid="id.classpath.samples"/>
<sysproperty key="proxyHost" value="${proxy.host}"/>
<sysproperty key="proxyPort" value="${proxy.port}"/>
</java>
<echo message="Generating an enveloped signature"/>
<java classname="javax.xml.crypto.dsig.samples.GenEnveloped"
fork="yes">
<arg value="${dir.src.samples}/javax/xml/crypto/dsig/samples/envelope.xml"/>
<classpath refid="id.classpath.samples"/>
</java>
<echo message="Generating an enveloping signature"/>
<java classname="javax.xml.crypto.dsig.samples.GenEnveloping"
fork="yes">
<classpath refid="id.classpath.samples"/>
</java>
<echo message="Validating a signature"/>
<java classname="javax.xml.crypto.dsig.samples.Validate"
fork="yes">
<arg value="${dir.src.samples}/javax/xml/crypto/dsig/samples/envelopedSignature.xml"/>
<classpath refid="id.classpath.samples"/>
</java>
</target>
<!-- D I S T R I B U T I O N T A R G E T S -->
<!-- distribution targets -->
<target name="build.dist"
depends="build.srcdist,build.bindist" />
<target name="build.srcdist"
description="Creates the source distribution" >
<mkdir dir="${dir.build.srcdist}"/>
<copy todir="${dir.build.srcdist}">
<fileset dir=".">
<patternset refid="id.patternset.distFiles"/>
<patternset refid="id.patternset.srcFiles"/>
<patternset refid="id.patternset.sampleFiles"/>
<include name="ant/**/*"/>
</fileset>
</copy>
<mkdir description="create an empty libs dir"
dir="${dir.build.srcdist}/libs"/>
<zip basedir="${dir.build.dist}/src"
zipfile="${dir.build}/${product.name}-src-${product_version}.zip"/>
</target>
<target name="build.bindist"
depends="build.src,build.docs"
description="Creates the binary distribution">
<mkdir dir="${dir.build.bindist}"/>
<copy todir="${dir.build.bindist}">
<fileset dir=".">
<patternset refid="id.patternset.distFiles"/>
<patternset refid="id.patternset.srcFiles"/>
<patternset refid="id.patternset.sampleFiles"/>
<include name="ant/**/*"/>
</fileset>
</copy>
<mkdir dir="${dir.build.bindist}/libs"/>
<copy file="${lib.xerces.1}"
todir="${dir.build.bindist}/libs"/>
<copy file="${lib.xalan.1}"
todir="${dir.build.bindist}/libs"/>
<copy file="${lib.xalan.2}"
todir="${dir.build.bindist}/libs"/>
<copy file="${lib.xalan.3}"
todir="${dir.build.bindist}/libs"/>
<copy file="${lib.logging}"
todir="${dir.build.bindist}/libs"/>
<copy description="copy xmlsec JAR"
file="${jar.library}"
todir="${dir.build.bindist}/libs"/>
<copy description="copy xmlsec sample JAR"
file="${jar.samples}"
todir="${dir.build.bindist}/libs"/>
<copy description="copy xmlsec test JAR"
file="${jar.tests}"
todir="${dir.build.bindist}/libs"/>
<mkdir dir="${dir.build.bindist}/doc"/>
<mkdir dir="${dir.build.bindist}/doc/Java/api" />
<copy todir="${dir.build.bindist}/doc/Java/api">
<fileset dir="${dir.build.docs.html}/javadoc"/>
</copy>
<zip basedir="${dir.build.dist}/bin"
zipfile="${dir.build}/${product.name}-bin-${product_version}.zip"/>
</target>
<!-- M I S C E L A N E O U S T A R G E T S -->
<!-- documentation -->
<target name="build.docs">
<mkdir dir="${dir.build.javadoc}"/>
<javadoc classpathref="id.classpath"
destdir="${dir.build.javadoc}">
<packageset dir="${dir.src}">
<include name="org/apache/xml/security/**"/>
<include name="javax/xml/crypto/**"/>
</packageset>
<group title="JSR 105 Packages" packages="javax.xml.crypto*"/>
<group title="XMLSec Packages" packages="org.apache.xml.security*"/>
</javadoc>
</target>
<target name="clover.report.html" depends="with.clover">
<clover-report>
<current outfile="${dir.build.coverage}"
title="Apache XML-Security coverage">
<fileset dir="${dir.src}">
<include name="**/*.java"/>
<exclude name="**/*Exception.java" />
</fileset>
<format type="html"/>
</current>
</clover-report>
</target>
<!-- jars -->
<target name="manifest">
<tstamp/>
<mkdir dir="${dir.manifest}"/>
<copy file="${basedir}/LICENSE" tofile="${dir.manifest}/LICENSE.txt"/>
<copy file="${basedir}/NOTICE" tofile="${dir.manifest}/NOTICE.txt"/>
<manifest file="${jar.manifest}" mode="replace">
<attribute name="Built-By" value="${user.name}"/>
<section name="${product.shortname}">
<attribute name="Implementation-Title"
value="${product.Name}"/>
<attribute name="Implementation-Version"
value="${product.version} ${TODAY}"/>
<attribute name="Implementation-Vendor"
value="Apache Software Foundation"/>
</section>
</manifest>
</target>
<target name="build.jar"
depends="manifest,build.src,build.test,build.samples">
<!-- Main Library -->
<jar basedir="${dir.build.bin}"
excludes="org/apache/xml/security/temp/**"
includes="org/apache/**, javax/xml/crypto/**"
destfile="${jar.library}"
manifest="${jar.manifest}">
<metainf file="${dir.manifest}/*.txt"/>
</jar>
<!-- Samples -->
<jar basedir="${dir.build.samples}"
excludes="org/apache/xml/security/temp/**"
includes="org/apache/**, javax/xml/crypto/**"
destfile="${jar.samples}"
manifest="${jar.manifest}">
<metainf file="${dir.manifest}/*.txt"/>
</jar>
<!-- Tests -->
<jar basedir="${dir.build.test}"
excludes="org/apache/xml/security/temp/**"
includes="org/apache/**, javax/xml/crypto/**"
destfile="${jar.tests}"
manifest="${jar.manifest}">
<metainf file="${dir.manifest}/*.txt"/>
</jar>
</target>
<target name="build.src.jar"
depends="manifest,build.src">
<jar basedir="${dir.build.bin}"
excludes="org/apache/xml/security/temp/**"
includes="**/LICENSE, **/NOTICE, org/apache/**, javax/xml/crypto/**, *.txt"
jarfile="${jar.library}"
manifest="${jar.manifest}"/>
</target>
<!-- archive targets -->
<target name="build.arch"
depends="env.mk.dirs" >
</target >
<!-- aliases -->
<target name="build.all" depends="env.mk.dirs,build.src,build.docs,build.test,build.samples,build.jar,build.arch" />
<target name="compile" depends="build.src" />
<target name="docs" depends="build.docs" />
<target name="javadoc" depends="build.docs" />
<target name="jar" depends="build.jar" />
<target name="dist" depends="build.dist" />
<target name="clean" depends="env.rm.dirs,env.rm.files"/>
<target name="gump" depends="clean, docs, jar, test"/>
<target name="clover" depends="clean, with.clover, test, clover.report.html" />
<!-- maintenance targets -->
<!-- help targets -->
<target depends="init" name="help" >
<echo message="synopsis: ant [target]" />
<echo message="targets:" />
<echo message="compile - builds xml-security source" />
<echo message="docs - creates java documentation" />
<echo message="jar - creates a jar file, containing the built source" />
<echo message="dist - creates a distribution" />
<echo message=" (see ant help.dist for more information)" />
<echo message="clean - resets the build environment" />
<echo message="test - performs a series of tests" />
<echo message=" (see ant help.test for more information)" />
<echo message="help - displays this help message (default)" />
<echo message=""/>
<echo message="See also help.samples for help on building samples"/>
</target >
<target depends="init" name="help.dist" >
<echo message="dist:" />
<echo message="this target will:" />
<echo message="1. build the source files," />
<echo message="2. create the appropriate java documentation," />
<echo message="3. create distribution jars," />
<echo message="4. copy the license, copies source and" />
<echo message="5. creates distribution archives" />
</target >
<target depends="init" name="help.test" >
<echo message="test - runs all unit and interop tests" />
<echo message="test_exc_c14n - runs the exclusive c14n tests" />
<echo message="test_xenc - does all encryption related tests" />
<echo message="clover - generates clover coverage reports" />
</target >
<target depends="init" name="help.samples" >
<echo message=""/>
<echo message="------------- Signature Samples ----------------"/>
<echo message=""/>
<echo message="sign - runs CreateSignature sample"/>
<echo message="verify - runs signature verification sample"/>
<echo message="signAndVerify - runs sign and then verify"/>
<echo message="axis-sign - runs axis signing sample"/>
<echo message="axis-verify - runs axis verification sample"/>
<echo message="AxisSignAndVerify - runs axis sign and verify"/>
<echo message="createEnvelope - runs enveloping signature sample"/>
<echo message="mega-sample - runs all big signature samples"/>
<echo message=""/>
<echo message="------------- Encryption Samples ----------------"/>
<echo message=""/>
<echo message="encrypt - run encryption sample" />
<echo message="decrypt - run decryption sample" />
<echo message="encryptAndDecrypt - run encryption sample" />
</target>
</project>