forked from RestComm/jain-sip
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
executable file
·985 lines (847 loc) · 47.6 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
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
<?xml version="1.0"?>
<!--
authors of build.xml: Initial: Olivier Deruelle [email protected]
Revisions and fixes by:
M. Ranganathan <[email protected]>
Gordon Ledgard <[email protected]>
Steven Lass <[email protected]>
Sverker Abrahamsson <[email protected]>
Majdi Abuelbassal <[email protected]>
Jean Deruelle <[email protected]>
Dan Muresan <[email protected]>
Jeroen van Bemmel <[email protected]>
Ivelin Ivanov <[email protected]>
Emil Ivov <[email protected]>
For using ANT:
Ant is a platform independent build tool.
Get the tool from www.apache.org and install. Set your path to the ant shell
(batch) file.
>From the command prompt, execute the following command:
ant target
Where avaliable targets are:
- ship -> Compiles all and wraps up this whole project into a tar file.
- all -> Builds everything: stack, tools, examples and docs.
- javadoc -> Builds java documentation.
- compiletools -> Compiles the tools directory.
- compileexamples -> Compiles the examples directory.
- compileri -> Compiles the reference implementation after cleaning and builds jars.
- compile -> complies the reference implementation but does clean or build jars.
- compilesdp -> Compiles the sdp
- compileapi -> Compiles the jainapi
- clean -> cleans everything: All the built stuff and temp files.
- init -> create the classes directory
- runtck -> Cleans, compile and run the tck.
On my machine I run this as follows:
c:/jakarta-ant/bin/ant all
-->
<project name="NIST-SIP" default="all">
<!-- Allow user to override defaults -->
<property file="ant-build-config.properties" />
<!-- set global properties for this build -->
<property name="root" value="." />
<property name="href.nist.homepage" value="http://www-x.antd.nist.gov/" />
<property name="href.uncopyright" value="../uncopyright.html" />
<property name="href.copyright" value="../copyright.html" />
<property name="href.mailto" value="mailto:[email protected]" />
<property name="href.distribution" value="http://jain-sip.dev.java.net" />
<property name="classes" value="${root}/classes" />
<property name="retrowoven" value="${root}/retrowoven" />
<property name="docdir" value="${root}/javadoc" />
<property name="srcroot" value="${root}/src" />
<property name="dist" value="dist" />
<property name="jain-sip-api-jar" value="${root}/jain-sip-api-1.2.jar" />
<property name="jain-sip-api-src-jar" value="${root}/jain-sip-api-1.2-src.jar" />
<property name='j2se_api' value='http://java.sun.com/j2se/1.5/docs/api' />
<property name="junit_jar" value="${junit}" />
<property name="log4j_jar" value="${log4j}" />
<property name="jdom_jar" value="${jdom}"/>
<property name="ant_jar" value="${ant}"/>
<property name="fail.build.on.tests.not.passing" value="true"/>
<property name="source.encoding" value="ISO-8859-1" />
<property environment="sys" />
<presetdef name="jain-javac">
<javac debug="${javac.debug}"
debuglevel="${javac.debuglevel}"
nowarn="${javac.nowarn}"
deprecation="${javac.deprecation}"
optimize="${javac.optimize}"
source="${javac.source}"
target="${javac.target}"
srcdir="${srcroot}"
destdir="${classes}" />
</presetdef>
<condition property="enableNIO" value="true">
<isset property="nioEnabled" />
</condition>
<target name="all" depends="make,compileexamples,compiletools,javadoc,javadoc-jain" />
<target name="all-android" depends="make,compiletools,javadoc,javadoc-jain,android-copy,android-replace,android-jar-sip-stack" />
<target name="make" depends="compileapi,compileri,compilesdp,jain-sip-sdp-jar" />
<target name="cleanlogs">
<delete failonerror="0">
<fileset file="*log.txt" />
<fileset file="tckoutput.txt" />
<fileset file="*debug*.txt" />
<fileset file="*Debug*.txt" />
<fileset file="*log*.txt" />
<fileset file="*Log*.txt" />
<fileset dir="./logs" />
<fileset dir="./test-reports" />
<fileset dir="./src" includes="**/*log*.txt" />
<fileset dir="./src" includes="**/*debug*.txt" />
<fileset dir="./src" includes="**/*log*.txt" />
<fileset dir="./src" includes="**/*debug*.txt" />
</delete>
</target>
<!-- Clean everything -->
<target name="clean" depends="cleanlogs,cleantars">
<delete dir="${classes}" quiet="true" failonerror="false" />
<delete dir="${retrowoven}" quiet="true" failonerror="false" />
<delete file="./tracesviewer.jar" failonerror="false" />
<delete dir='javadoc' quiet="true" failonerror="false" />
<delete dir='javadoc-jain' quiet="true" failonerror="false" />
<delete dir='src/android' quiet="true" failonerror="false" />
<delete dir='android-javadoc' quiet="true" failonerror="false" />
<delete dir="${dist}" quiet="true" failonerror="false" />
</target>
<target name="cleantars" >
<delete failonerror="0">
<fileset file="*.jar"/>
<fileset file="*.tar.gz"/>
</delete>
</target>
<target name="check_java_version">
<!-- JvB: Check for Java 1.5 -->
<available classname="java.lang.ProcessBuilder" property="jdk15.available" />
<!-- JvB: New: also check for Java 7, for SCTP support -->
<available classname="java.security.cert.CertificateRevokedException" property="jdk7.available"/>
</target>
<!-- Create ${classes} -->
<target name="init" depends="generate-version">
<mkdir dir="${classes}" />
</target>
<target name="cleandocs">
<delete dir="javadoc" />
</target>
<target name="javadoc">
<mkdir dir="${docdir}" />
<copy toDir="${docdir}">
<fileset dir="src/javax/sip" includes="**/*.html" />
</copy>
<javadoc packagenames="javax.sip.*,javax.sip.header.*,javax.sip.message.*,javax.sip.address.*,gov.nist.javax.sip.*,gov.nist.javax.sip.address.*,gov.nist.javax.sip.message.*,gov.nist.javax.sip.header.*,gov.nist.javas.sip.header.ims.*,gov.nist.javax.sip.stack.*,gov.nist.core.net.*,gov.nist.javax.sip.parser.*,javax.sdp.*,gov.nist.javax.sdp.*,gov.nist.javax.sdp.fields.*" sourcepath="${srcroot}" overview="${docdir}/overview.html" destdir="javadoc" use="true" splitindex="true" windowtitle="The JAIN-SIP-1.2 RI For the People !" doctitle="NIST-SIP: The Reference Implementation for JAIN-SIP 1.2" public="true" author="true" version="true" defaultexcludes="yes" additionalparam="-breakiterator">
<classpath>
<pathelement location="${log4j_jar}" />
<pathelement location="${jain-sip-api-jar}" />
</classpath>
<link href="${j2se_api}" />
<header>
<![CDATA[
<b> NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 </b>
]]>
</header>
<bottom>
<![CDATA[
<font size="-1">
<a href="${href.nist.homepage}"> A product of the NIST/ITL Advanced Networking Technologies Division. </a>
<br>
<a href="${href.uncopyright}"> See conditions of use. </a>
<br>
<a href="${href.mailto}">Submit a bug report or feature request. </a>
<br>
</font>
]]>
</bottom>
</javadoc>
</target>
<target name="javadoc-jain">
<mkdir dir='javadoc-jain' />
<javadoc packagenames="javax.sip.*,javax.sip.header.*,javax.sip.message.*,javax.sip.address.*,javax.sdp.*" sourcepath="${srcroot}" overview="${docdir}/overview.html" destdir="javadoc-jain" use="true" splitindex="true" windowtitle="JAIN-SIP-1.2 RI For the People !" doctitle="NIST SIP/SDP Parser and Stack (v1.3)" public="true" author="true" version="true" defaultexcludes="yes" additionalparam="-breakiterator">
<classpath>
<pathelement location="${jain-sip-api-jar}" />
</classpath>
<link href="${j2se_api}" />
<header>
<![CDATA[
<b> JAIN-SIP 1.2 API </b>
]]>
</header>
<bottom>
<![CDATA[
<font size="-1">
<a href="NIST, BEA Systems, Sun Microsystems and others" </a>
<br>
<a href="${href.copyright}"> See conditions of use. </a>
<br>
<a href="${href.mailto}">Submit a bug report or feature request. </a>
<br>
</font>
]]>
</bottom>
</javadoc>
</target>
<!-- Compile the stack and libraries -->
<target name="compileapi" depends="init">
<jain-javac includes="javax/sip/**/*.java" />
<jar destfile="${jain-sip-api-jar}" basedir="${classes}" includes="javax/sip/**/*.class" >
<manifest>
<attribute name="Original-Jar-Name"
value="${jain-sip-api-jar}"/>
</manifest>
</jar>
<jar destfile="${jain-sip-api-src-jar}" basedir="${srcroot}" includes="TIMESTAMP,javax/sip/**/*.java">
<manifest>
<attribute name="Original-Jar-Name"
value="${jain-sip-api-src-jar}"/>
</manifest>
</jar>
</target>
<!-- Compile but dont build any jars -->
<target name="compile" depends="init,compileapi">
<jain-javac includes="gov/nist/core/**/*.java, gov/nist/javax/sip/**/*.java"
excludes="gov/nist/javax/sip/stack/sctp/**/*.java">
<classpath>
<pathelement location="${log4j_jar}" />
</classpath>
</jain-javac>
</target>
<!-- Ant tools -->
<target name="ant-tools" >
<mkdir dir="${classes}" />
<jain-javac srcdir="ant-tasks/src" includes="net/java/jsip/ant/**/*.java">
<classpath>
<pathelement location="${jdom_jar}" />
<pathelement location="${ant_jar}" />
</classpath>
</jain-javac>
</target>
<!-- Compile and build jars -->
<target name="compileri" depends="init,compileapi">
<jain-javac includes="gov/nist/core/**/*.java, gov/nist/javax/sip/**/*.java"
excludes="gov/nist/javax/sip/stack/sctp/**/*.java">
<classpath>
<pathelement location="${log4j_jar}" />
</classpath>
</jain-javac>
<copy file="TIMESTAMP" toDir="classes/" />
<jar destfile="${jain-sip-ri-jar}" basedir="${classes}" includes="TIMESTAMP,gov/nist/**/*.class"
excludes="gov/nist/javax/sip/stack/sctp/**/*.class">
<manifest>
<attribute name="Original-Jar-Name"
value="${jain-sip-ri-jar}"/>
</manifest>
</jar>
<jar destfile="${jain-sip-src-jar}" basedir="${srcroot}" includes="TIMESTAMP,gov/nist/**/*.java"
excludes="gov/nist/javax/sip/stack/sctp/**/*.java">
<manifest>
<attribute name="Original-Jar-Name"
value="${jain-sip-src-jar}"/>
</manifest>
</jar>
</target>
<target name="compilesdp" depends="init">
<jain-javac includes="javax/sdp/**/*.java, gov/nist/javax/sdp/**/*.java">
<classpath>
<pathelement location="${log4j_jar}" />
</classpath>
</jain-javac>
<jar destfile="${sdp_jar}" basedir="${classes}" includes="gov/nist/core/**/*.class,gov/nist/javax/sdp/**/*.class,javax/sdp/**/*.class" >
<manifest>
<attribute name="Original-Jar-Name"
value="${sdp_jar}"/>
</manifest>
</jar>
<jar destfile="${sdp-src-jar}" basedir="${srcroot}" includes="gov/nist/core/**/*.java,gov/nist/javax/sdp/**/*.java,javax/sdp/**/*.java" >
<manifest>
<attribute name="Original-Jar-Name"
value="${sdp-src-jar}"/>
</manifest>
</jar>
</target>
<target name="compilesctp" depends="check_java_version" if="jdk7.available">
<javac debug="${javac.debug}" debuglevel="${javac.debuglevel}"
nowarn="${javac.nowarn}" deprecation="${javac.deprecation}"
optimize="${javac.optimize}" srcdir="${srcroot}"
source="1.7" target="1.7"
includes="gov/nist/javax/sip/stack/sctp/**/*.java" destdir="${classes}">
<classpath>
<pathelement location="${classes}" />
<pathelement location="${log4j_jar}" />
</classpath>
</javac>
<jar destfile="${jain-sip-sctp-jar}" basedir="${classes}"
includes="gov/nist/javax/sip/stack/sctp/**/*.class" />
</target>
<target name="compileunit" depends="init">
<copy file="src/test/torture/torture.xml" toDir="classes/test/torture/" />
<copy file="src/test/torture/torture.dtd" toDir="classes/test/torture/" />
<jain-javac includes="test/unit/**/*.java,test/torture/**/*.java">
<classpath>
<pathelement location="${log4j_jar}" />
<pathelement location="${junit_jar}" />
<pathelement location='lib/sipxcommons.jar' />
</classpath>
</jain-javac>
<jar destfile="${unit_test_jar}" basedir="${classes}" includes="test/unit/**/*.class,test/torture/**/*" />
</target>
<target name="jain-sip-sdp-jar" depends="compilejain,generate-version">
<copy file="TIMESTAMP" toDir="classes/" />
<copy file="version.txt" toDir="classes/" />
<jar destfile="${jain-sip-sdp-jar}" basedir="${classes}" includes="TIMESTAMP,version.txt,javax/**/*.class,gov/nist/**/*.class" >
<manifest>
<attribute name="Original-Jar-Name"
value="${jain-sip-sdp-jar}"/>
</manifest>
</jar>
</target>
<target name='compilejain' depends='init,compile,compilesdp,compilesctp' />
<!-- Compile the examples -->
<target name="compileexamples" depends="init">
<jain-javac includes="examples/**/*.java">
<classpath>
<pathelement location="${log4j_jar}" />
<pathelement location="${junit_jar}" />
<pathelement location="${jakarta_regexp_jar}" />
</classpath>
</jain-javac>
</target>
<!-- Compile the tck, always with debug on -->
<target name="compiletck" depends="init,compileri,compilesctp">
<mkdir dir="${classes}" />
<jain-javac>
<include name="test/tck/**/*.java" />
<include name="test/rihelper/**/*.java" />
<classpath>
<pathelement location='${junit_jar}' />
<pathelement location='${log4j_jar}' />
</classpath>
</jain-javac>
<jar destfile="${jain-sip-tck-jar}" basedir="${classes}">
<include name="test/tck/**/*.class" />
<include name="test/rihelper/**/*.class" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="test.tck.Tck" />
</manifest>
</jar>
<copy file="tck.properties" toDir="./classes" />
</target>
<!-- this uses the junit task of ant to run the tck in self test mode -->
<target name='runtck' depends="compiletck" description="Runs all TCK tests using the ant junit task.">
<mkdir dir="test-reports" />
<mkdir dir="logs" />
<junit fork="yes" showoutput="yes" failureproperty="testing.failed">
<sysproperty key="enableNIO" value="${enableNIO}"/>
<classpath>
<pathelement location="${jain-sip-api-jar}" />
<pathelement location="${jain-sip-ri-jar}" />
<pathelement location="${log4j_jar}" />
<pathelement location="${jain-sip-tck-jar}" />
<pathelement location='${junit_jar}' />
<pathelement location='${log4j_jar}' />
<pathelement location='${jain-sip-sctp-jar}'/> <!-- only for Java 7 -->
<!-- add source path since this will pick up test.tck.gui.images -->
<pathelement location='src' />
<!-- add project root to the classpath in order to make tck.properties accessible. -->
<pathelement location="${root}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="test-reports" haltonfailure="no">
<fileset dir="${srcroot}">
<include name="test/tck/**/*Test.java" />
<!-- TCP Tests excluded - its enough to test one transport for TCK compliance -->
<exclude name="**/Tcp*Test.java" />
<exclude name="**/TCP*Test.java" />
<!-- Tls Tests excluded for tck compliance -->
<exclude name="test/tck/msgflow/callflows/tls/*Test.java" />
<exclude name="test/tck/msgflow/callflows/sctp/*Test.java" />
</fileset>
</batchtest>
</junit>
<echo>The test report can be found at ./test-reports/html/index.html</echo>
<condition property="fail.build">
<and>
<equals arg1="${fail.build.on.tests.not.passing}" arg2="true"/>
<isset property="testing.failed"/>
</and>
</condition>
<echo message="The value of properties are ${fail.build.on.tests.not.passing} and ${testing.failed}" />
<fail if="${fail.build}"/>
</target>
<!-- runs tcp and tls. These are not included in regression. -->
<target name='runtckcallflows' depends="compiletck" description="Runs all TCK tests using the ant junit task.">
<mkdir dir="test-reports" />
<mkdir dir="logs" />
<junit fork="yes" showoutput="yes" failureproperty="testing.failed">
<sysproperty key="enableNIO" value="${enableNIO}"/>
<classpath>
<pathelement location="${jain-sip-api-jar}" />
<pathelement location="${jain-sip-ri-jar}" />
<pathelement location="${log4j_jar}" />
<pathelement location="${jain-sip-tck-jar}" />
<pathelement location='${junit_jar}' />
<pathelement location='${log4j_jar}' />
<!-- add source path since this will pick up test.tck.gui.images -->
<pathelement location='src' />
<!-- add project root to the classpath in order to make tck.properties accessible. -->
<pathelement location="${root}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="test-reports" haltonfailure="no">
<fileset dir="${srcroot}">
<include name="test/tck/msgflow/callflows/**/*Test.java" />
<exclude name="test/tck/msgflow/callflows/**/Udp*Test.java" />
<exclude name="test/tck/msgflow/callflows/sctp/**" />
<!-- Tls Tests excluded for tck compliance -->
<exclude name="test/tck/msgflow/callflows/tls/*Test.java" />
<exclude name="test/tck/msgflow/callflows/sctp/*Test.java" />
</fileset>
</batchtest>
</junit>
<echo>The test report can be found at ./test-reports/html/index.html</echo>
<condition property="fail.build">
<and>
<equals arg1="${fail.build.on.tests.not.passing}" arg2="true"/>
<isset property="testing.failed"/>
</and>
</condition>
<echo message="The value of properties are ${fail.build.on.tests.not.passing} and ${testing.failed}" />
<fail if="${fail.build}"/>
</target>
<!-- target for an individual unit test -->
<target name='tlstests' depends="compileunit" description="Runs unit tests not included in tck.">
<mkdir dir="test-reports" />
<delete failonerror="0">
<fileset file="logs/*" />
</delete>
<mkdir dir="logs" />
<copy file="src/test/unit/gov/nist/javax/sip/stack/tls/testkeys" toDir= "classes/test/unit/gov/nist/javax/sip/stack/tls" />
<copy file="src/test/tck/msgflow/callflows/tls/testkeys" toDir="classes/test/tck/msgflow/callflows/tls" />
<junit fork="yes" showoutput="yes" failureproperty="testing.failed">
<classpath>
<pathelement location="${classes}" />
<pathelement location="${log4j_jar}" />
<pathelement location='${junit_jar}' />
<pathelement location='${log4j_jar}' />
<!-- add source path since this will pick up test.tck.gui.images -->
<pathelement location='src' />
<!-- add project root to the classpath in order to make tck.properties accessible. -->
<pathelement location="${root}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="test-reports" haltonfailure="no">
<fileset dir="${srcroot}">
<include name="test/unit/gov/nist/javax/sip/stack/tls/*Test.java" />
<include name="test/tck/msgflow/callflows/tls/*Test.java" />
</fileset>
</batchtest>
</junit>
<echo>The test report can be found at ./test-reports/html/index.html</echo>
<condition property="fail.build">
<and>
<equals arg1="${fail.build.on.tests.not.passing}" arg2="true"/>
<isset property="testing.failed"/>
</and>
</condition>
<echo message="The value of properties are ${fail.build.on.tests.not.passing} and ${testing.failed}" />
<fail if="${fail.build}"/>
</target>
<!-- target for an individual unit test -->
<target name='unit2' depends="compileunit" description="Runs unit tests not included in tck.">
<mkdir dir="test-reports" />
<delete failonerror="0">
<fileset file="logs/*" />
</delete>
<mkdir dir="logs" />
<junit fork="yes" showoutput="yes" failureproperty="testing.failed">
<classpath>
<pathelement location="${jain-sip-api-jar}" />
<pathelement location="${jain-sip-ri-jar}" />
<pathelement location="${log4j_jar}" />
<pathelement location="${jain-sip-tck-jar}" />
<pathelement location='${junit_jar}' />
<pathelement location='${log4j_jar}' />
<pathelement location='${unit_test_jar}' />
<!-- add source path since this will pick up test.tck.gui.images -->
<pathelement location='src' />
<!-- add project root to the classpath in order to make tck.properties accessible. -->
<pathelement location="${root}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="test-reports" haltonfailure="no">
<fileset dir="${srcroot}">
<include name="test/unit/gov/nist/javax/sip/stack/reinvitechallenge/*Test.java" />
</fileset>
</batchtest>
</junit>
<echo>The test report can be found at ./test-reports/html/index.html</echo>
<condition property="fail.build">
<and>
<equals arg1="${fail.build.on.tests.not.passing}" arg2="true"/>
<isset property="testing.failed"/>
</and>
</condition>
<echo message="The value of properties are ${fail.build.on.tests.not.passing} and ${testing.failed}" />
<fail if="${fail.build}"/>
</target>
<target name='unittest' depends="compileunit" description="Runs unit tests not included in tck.">
<mkdir dir="test-reports" />
<delete failonerror="0">
<fileset file="logs/*" />
</delete>
<mkdir dir="logs" />
<junit fork="yes" showoutput="yes" failureproperty="testing.failed">
<sysproperty key="enableNIO" value="${enableNIO}"/>
<classpath>
<pathelement location="${jain-sip-api-jar}" />
<pathelement location="${jain-sip-ri-jar}" />
<pathelement location="${log4j_jar}" />
<pathelement location="${jain-sip-tck-jar}" />
<pathelement location='${junit_jar}' />
<pathelement location='${log4j_jar}' />
<pathelement location='${unit_test_jar}' />
<!-- add source path since this will pick up test.tck.gui.images -->
<pathelement location='src' />
<!-- add project root to the classpath in order to make tck.properties accessible. -->
<pathelement location="${root}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="test-reports" haltonfailure="no">
<fileset dir="${srcroot}">
<include name="test/unit/gov/nist/javax/**/*Test.java" />
<exclude name="test/unit/gov/nist/javax/sip/stack/NonRfc3261ForkedInviteTest.java" />
<exclude name="test/unit/gov/nist/javax/sip/stack/SimpleDialogRecoveryTest.java" />
<exclude name="test/unit/gov/nist/javax/sip/stack/tls/*Test.java" />
</fileset>
</batchtest>
</junit>
<echo>The test report can be found at ./test-reports/html/index.html</echo>
<condition property="fail.build">
<and>
<equals arg1="${fail.build.on.tests.not.passing}" arg2="true"/>
<isset property="testing.failed"/>
</and>
</condition>
<echo message="The value of properties are ${fail.build.on.tests.not.passing} and ${testing.failed}" />
<fail if="${fail.build}"/>
</target>
<!-- target for running the parser tests -->
<target name='torture' depends="compileunit" description="Runs all unit tests using the ant junit task.">
<mkdir dir="test-reports" />
<mkdir dir="logs" />
<copy file="src/test/torture/torture.xml" toDir="classes/test/torture/" />
<copy file="src/test/torture/torture.dtd" toDir="classes/test/torture/" />
<junit fork="yes" showoutput="yes" failureproperty="testing.failed">
<classpath>
<pathelement location="${classes}" />
<pathelement location="${jain-sip-sdp-jar}" />
<pathelement location="${jain-sip-ri-jar}" />
<pathelement location="${log4j_jar}" />
<pathelement location='${junit_jar}' />
<pathelement location='${log4j_jar}' />
<pathelement location='${unit_test_jar}' />
<!-- add project root to the classpath in order to make tck.properties accessible. -->
<pathelement location="${root}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="test-reports" haltonfailure="no">
<fileset dir="${srcroot}">
<include name="test/torture/TortureTest.java" />
</fileset>
</batchtest>
</junit>
<echo>The test report can be found at ./test-reports/html/index.html</echo>
<condition property="fail.build">
<and>
<equals arg1="${fail.build.on.tests.not.passing}" arg2="true"/>
<isset property="testing.failed"/>
</and>
</condition>
<echo message="The value of properties are ${fail.build.on.tests.not.passing} and ${testing.failed}" />
<fail if="${fail.build}"/>
</target>
<target name='parsertest' depends='compileunit' description="Runs all unit tests using the ant junit task.">
<mkdir dir="test-reports" />
<mkdir dir="logs" />
<junit fork="yes" showoutput="yes" failureproperty="testing.failed">
<sysproperty key="enableNIO" value="${enableNIO}"/>
<classpath>
<pathelement location="${jain-sip-sdp-jar}" />
<pathelement location="${jain-sip-ri-jar}" />
<pathelement location="${log4j_jar}" />
<pathelement location='${junit_jar}' />
<pathelement location='${log4j_jar}' />
<pathelement location='${unit_test_jar}' />
<!-- add project root to the classpath in order to make tck.properties accessible. -->
<pathelement location="${root}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="test-reports" haltonfailure="no">
<fileset dir="${srcroot}">
<include name="test/torture/TortureTest.java" />
<include name="test/unit/**/*ParserTest.java" />
</fileset>
</batchtest>
</junit>
<echo>The test report can be found at ./test-reports/html/index.html</echo>
<condition property="fail.build">
<and>
<equals arg1="${fail.build.on.tests.not.passing}" arg2="true"/>
<isset property="testing.failed"/>
</and>
</condition>
<echo message="The value of properties are ${fail.build.on.tests.not.passing} and ${testing.failed}" />
<fail if="${fail.build}"/>
</target>
<!-- Generate a tar file -->
<target name="srctar" depends="init" >
<tar compression="gzip" basedir="../" destfile="${jain-sip-src-tar}"
includes="${top}/**/*/"
excludes="${top}/www/**/*,${top}/javax/**/*,${top}/repo/**/*,${top}/ant-tasks/lib/**/*,${top}/test-reports/**/*,${top}/classes/**/*,${top}/javadoc/**/*,${top}/*.jar,${top}/lib/**/*,${top}/tckoutput.txt,${top}/*.gz,${top}/poms/**/*" />
</target>
<target name="javadoctar" depends="init,javadoc" >
<touch file="${jain-sip-javadoc-tar}" />
<tar compression="gzip" basedir="../" destfile="${jain-sip-javadoc-tar}"
includes="${top}/javadoc/**/*" />
</target>
<target name="alltar" depends="init" >
<tar compression="gzip" basedir="../" destfile="${jain-sip-all-tar}"
includes="${top}/**/*/"
excludes="${top}/*.tar.gz" />
</target>
<!-- builds the distribution -->
<target name="dist" depends="make,compiletck,javadoctar,alltar,srctar">
<mkdir dir="${dist}" />
<mkdir dir="${dist}/jain-sdp" />
<mkdir dir="${dist}/jain-sip-javadoc" />
<mkdir dir="${dist}/jain-sip-sdp"/>
<mkdir dir="${dist}/jain-sip-api"/>
<mkdir dir="${dist}/jain-sip-ri"/>
<mkdir dir="${dist}/jain-sip-tck" />
<mkdir dir="${dist}/jain-sip-src" />
<mkdir dir="${dist}/jain-sip-all" />
<copy file="${jain-sip-javadoc-tar}" todir="${dist}/jain-sip-javadoc" />
<copy file="${jain-sip-src-tar}" todir="${dist}/jain-sip-src" />
<copy file="${jain-sip-api-jar}" todir="${dist}/jain-sip-api"/>
<copy file="${jain-sip-ri-jar}" todir="${dist}/jain-sip-ri"/>
<copy file="${jain-sip-sdp-jar}" todir="${dist}/jain-sip-sdp"/>
<copy file="${sdp_jar}" todir="${dist}/jain-sdp"/>
<copy file="${jain-sip-tck-jar}" todir ="${dist}/jain-sip-tck" />
<copy file="${jain-sip-all-tar}" todir="${dist}/jain-sip-all" />
<copy file="README-DISTRIBUTION" todir="${dist}"/>
</target>
<!-- This is the build verification test run by cruise control. -->
<target name="cc-buildloop" depends="generate-version,dist,runtck,runtckcallflows,parsertest,unittest" />
<!-- compile to traces viewer jar -->
<target name="viewerjar">
<copy todir="${classes}/tools/tracesviewer/images">
<fileset dir="${srcroot}/tools/tracesviewer/images" />
</copy>
<jar compress="false" destfile="tracesviewer.jar">
<fileset dir="${classes}">
<include name="tools/tracesviewer/**/*.*" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="tools.tracesviewer.TracesViewer" />
</manifest>
</jar>
</target>
<!-- Compile the tools -->
<target name="compiletools" depends="init">
<jain-javac includes="tools/tracesviewer/**/*.java">
<classpath>
<pathelement location="${classes}" />
</classpath>
</jain-javac>
<copy todir="${classes}/tools/tracesviewer/images">
<fileset dir="${srcroot}/tools/tracesviewer/images" />
</copy>
<jain-javac includes="tools/sniffer/**/*.java">
<classpath>
<pathelement location="${classes}" />
</classpath>
</jain-javac>
</target>
<!-- Push the jar to maven -->
<target name="push-to-maven-prepare">
<taskdef resource="maven-repository-importer.properties">
<classpath>
<pathelement path="tools/maven-repository-importer-1.2.jar" />
</classpath>
</taskdef>
<delete dir="build/maven-repo" />
<!-- clean it -->
<maven-repository-importer destdir="build/maven-repo" version="1.2">
<artifact jar="jain-sip-api-1.2.jar" pom="poms/api-pom.xml" />
<artifact jar="jain-sip-ri-1.2.jar" pom="poms/ri-pom.xml" />
</maven-repository-importer>
</target>
<target name="push-to-maven" depends="push-to-maven-prepare">
<!-- import to CVS-->
<tstamp />
<echo>importing to CVS...</echo>
<cvs dest="build/maven-repo">
<commandline>
<argument value="-d:pserver:${user.name}@cvs.dev.java.net:/cvs" />
<argument line="-z9 import -ko -W *.jar -kb -m" />
<argument value="deploying new jars to the java.net maven repository" />
<argument value="jain-sip/repo" />
<argument line="deployment-to-maven-repository t${DSTAMP}${TSTAMP}" />
</commandline>
</cvs>
</target>
<import file="ant-tasks/build.xml" />
<target name="test">
<echo>SHELL ${sys.MAKE_MODE}</echo>
</target>
<target name="init-m2-exec">
<echo>To perform m2 release You have to follow insitrction from: https://maven2-repository.dev.java.net/ and have access as m2 submiter.</echo>
<sleep seconds="4"/>
<condition property="executable" value="mvn.bat">
<os family="windows" />
</condition>
<property name="executable" value="mvn" />
</target>
<target name="exec-m2" depends="init-m2-exec">
<exec executable="${executable}">
<arg value="-f" />
<arg value="${ant.file.NIST-SIP}/../m2/pom.xml" />
<arg value="deploy" />
<arg value="clean" />
</exec>
</target>
<target name="update-from-cvs">
<!-- Here we update version.txt file to what version may reside in cvs: overide local value to repo!! -->
<!-- cvs -d :pserver:user:[email protected]:/cvs update version.txt -C -->
<cvs>
<commandline>
<argument value="-d:pserver:${user.name}@cvs.dev.java.net:/cvs" />
<argument line="-z9 update -C version.txt" />
</commandline>
</cvs>
</target>
<!-- Task to generate a vesion number -->
<target name="generate-timestamp" >
<tstamp />
<echo file="TIMESTAMP" message="Date = ${DSTAMP} Time = ${TSTAMP}" />
</target>
<target name="generate-version" depends="ant-tools,svn-revision,generate-timestamp" >
<property file="ant-version.properties" />
<taskdef name="versioner" classname="net.java.jsip.ant.tasks.VersionerTask" classpath="classes"/>
<versioner cvsVersionFile="${ant.file.NIST-SIP}/../version.txt" incrementCVSVersion="false"/>
</target>
<target name="perform-m2-release" depends="ant-tools" description="Performs m2 deployment" >
<antcall target="update-from-cvs" />
<taskdef name="versioner" classname="net.java.jsip.ant.tasks.VersionerTask" classpath="classes"/>
<versioner cvsversionfile="${ant.file.NIST-SIP}/../version.txt" incrementcvsversion="false" parent="true" pomfile="${ant.file.NIST-SIP}/../m2/jain-sip-api/pom.xml" />
<versioner cvsversionfile="${ant.file.NIST-SIP}/../version.txt" incrementcvsversion="false" parent="true" pomfile="${ant.file.NIST-SIP}/../m2/jain-sip-ri/pom.xml" />
<versioner cvsversionfile="${ant.file.NIST-SIP}/../version.txt" incrementcvsversion="false" parent="true" pomfile="${ant.file.NIST-SIP}/../m2/nist-sdp/pom.xml" />
<versioner cvsversionfile="${ant.file.NIST-SIP}/../version.txt" incrementcvsversion="false" parent="false" pomfile="${ant.file.NIST-SIP}/../m2/pom.xml" />
<antcall target="exec-m2" />
<antcall target="update-cvs" />
<antcall target="clean-tasks" />
</target>
<target name="svn-revision">
<exec executable="svnversion" spawn="false" dir="./" output="version.txt">
<arg line="."/>
</exec>
</target>
<target name="android-copy">
<echo>Copying source for android</echo>
<copy encoding="${source.encoding}" outputencoding="${source.encoding}"
todir="src/android/gov/nist">
<fileset dir="src/gov/nist" />
</copy>
<copy encoding="${source.encoding}" outputencoding="${source.encoding}"
todir="src/android/gov/nist/javax/sdp">
<fileset dir="src/gov/nist/javax/sdp" />
</copy>
<copy encoding="${source.encoding}" outputencoding="${source.encoding}"
todir="src/android/gov/nist/javax/sip">
<fileset dir="src/gov/nist/javax/sip" />
</copy>
<copy encoding="${source.encoding}" outputencoding="${source.encoding}"
todir="src/android/javax">
<fileset dir="src/javax" />
</copy>
</target>
<target name="android-replace">
<echo>Modifying source for android</echo>
<replace dir="src/android/" value="android.javax.sip">
<replacetoken>javax.sip</replacetoken>
</replace>
<replace dir="src/android/" value="android.javax.sdp">
<replacetoken>javax.sdp</replacetoken>
</replace>
<replace dir="src/android/" value="android.gov.nist.core">
<replacetoken>gov.nist.core</replacetoken>
</replace>
<replace dir="src/android/" value="android.gov.nist.javax.sdp">
<replacetoken>gov.nist.android.javax.sdp</replacetoken>
</replace>
<replace dir="src/android/" value="android.gov.nist.javax.sip">
<replacetoken>gov.nist.android.javax.sip</replacetoken>
</replace>
<replace dir="src/android/" value=".javax.sip">
<replacetoken>.android.javax.sip</replacetoken>
</replace>
<replace dir="src/android/javax/sip" value=""javax.sip.message">
<replacetoken>"android.javax.sip.message</replacetoken>
</replace>
<replace dir="src/android/javax/sip" value=""javax.sip.header">
<replacetoken>"android.javax.sip.header</replacetoken>
</replace>
<replace dir="src/android/javax/sip" value=""javax.sip.address">
<replacetoken>"android.javax.sip.address</replacetoken>
</replace>
</target>
<target name="android-jar-sip-stack" depends="check_java_version"
if="jdk7.available">
<echo>Building SIP Library for android</echo>
<javac debug="${javac.debug}" debuglevel="${javac.debuglevel}"
nowarn="${javac.nowarn}" deprecation="${javac.deprecation}" optimize="${javac.optimize}"
srcdir="${srcroot}" source="1.7" target="1.7" encoding="${source.encoding}"
includes="android/**/*.java," destdir="${classes}">
<classpath>
<pathelement location="${classes}" />
<pathelement location="${log4j_jar}" />
</classpath>
</javac>
<jar destfile="dist/android/android-sip-stack.jar" basedir="${classes}"
includes="javax/**/*.class,android/**/*.class" />
</target>
<target name="android-javadoc">
<mkdir dir="${root}/android-javadoc" />
<copy toDir="${root}/android-javadoc">
<fileset dir="src/android/javax/sip" includes="**/*.html" />
</copy>
<javadoc packagenames="android.*" sourcepath="${srcroot}"
overview="${docdir}/overview.html" destdir="android-javadoc" use="true"
splitindex="true" windowtitle="The JAIN-SIP-1.2 RI For the People !"
doctitle="NIST-SIP: The Reference Implementation for JAIN-SIP 1.2"
public="true" author="true" version="true" defaultexcludes="yes" encoding="${source.encoding}" charset="${source.encoding}" docencoding="${source.encoding}"
additionalparam="-breakiterator">
<classpath>
<pathelement location="${log4j_jar}" />
<pathelement location="${jain-sip-api-jar}" />
</classpath>
<link href="${j2se_api}" />
<header>
<![CDATA[
<b> NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 </b>
]]>
</header>
<bottom>
<![CDATA[
<font size="-1">
<a href="${href.nist.homepage}"> A product of the NIST/ITL Advanced Networking Technologies Division. </a>
<br>
<a href="${href.uncopyright}"> See conditions of use. </a>
<br>
<a href="${href.mailto}">Submit a bug report or feature request. </a>
<br>
</font>
]]>
</bottom>
</javadoc>
</target>
</project>