forked from jitsi/jitsi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
2960 lines (2619 loc) · 142 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by Emil Ivov on Jul 6, 2005 8:30:22 PM-->
<project default="ant-usage" name="jitsi">
<dirname property="sc.basedir" file="${ant.file.jitsi}"/>
<property environment="system"/>
<property name="jdk.home" value="/usr/java/java"/>
<property name="dest" value="classes"/>
<property name="bundles.dest" value="sc-bundles"/>
<property name="bundles.dest.mac" value="${bundles.dest}/os-specific/macosx"/>
<property name="bundles.dest.win" value="${bundles.dest}/os-specific/windows"/>
<property name="bundles.dest.lin" value="${bundles.dest}/os-specific/linux"/>
<property name="bundles.dest.sol" value="${bundles.dest}/os-specific/solaris"/>
<property name="bundles.dest.freebsd" value="${bundles.dest}/os-specific/freebsd"/>
<property name="bundles.dest.android" value="${bundles.dest}/os-specific/android"/>
<property name="doc" value="doc"/>
<property name="java.doc" value="${doc}/api"/>
<property name="lib" value="${sc.basedir}/lib"/>
<property name="lib.win" value="${lib}/os-specific/windows"/>
<property name="lib.win.noinst" value="${lib}/os-specific/windows/installer-exclude"/>
<property name="lib.lin" value="${lib}/os-specific/linux"/>
<property name="lib.lin.noinst" value="${lib}/os-specific/linux/installer-exclude"/>
<property name="lib.mac" value="${lib}/os-specific/mac"/>
<property name="lib.mac.noinst" value="${lib}/os-specific/mac/installer-exclude"/>
<property name="lib.sol" value="${lib}/os-specific/solaris"/>
<property name="lib.sol.noinst" value="${lib}/os-specific/solaris/installer-exclude"/>
<property name="lib.freebsd" value="${lib}/os-specific/freebsd"/>
<property name="lib.freebsd.noinst" value="${lib}/os-specific/freebsd/installer-exclude"/>
<property name="lib.noinst" value="${lib}/installer-exclude"/>
<property name="native.libs" value="${lib}/native"/>
<property name="src" value="${sc.basedir}/src"/>
<property name="src2" value="${sc.basedir}/test"/>
<property name="testsrc" value="${src2}"/>
<property name="home" value="${system.HOME}"/>
<property name="bin" value="sip-communicator.bin"/>
<property name="utest.bin" value="sip-communicator.utest.bin"/>
<property name="test.reports.dir" value="test-reports"/>
<property name="test.html.reports.dir" value="${test.reports.dir}/html"/>
<property name="test.local.properties.file" value="${lib}/testing.properties"/>
<property name="test.accounts.properties.file" value="${lib}/accounts.properties"/>
<property name="release" value="release"/>
<property name="log" value="log"/>
<property name="release.src" value="${release}/install"/>
<property name="resources" value="${dest}/resources"/>
<property name="inst.resrc" value="${sc.basedir}/resources/install"/>
<property name='j2se_api' value='http://java.sun.com/j2se/1.5/docs/api' />
<property name='maxwarns' value='10000' />
<property name='java.net.preferIPv6Addresses' value='true' />
<!-- set the build label property and make it take the cc bild into account -->
<condition property="build.label"
value="${label}">
<isset property="label"/>
</condition>
<!-- windows specific properties -->
<condition property="is.running.windows" value="${os.name}">
<os family="windows"/>
</condition>
<condition property="os.lib.home" value="${lib.win}">
<and>
<isset property="is.running.windows"/>
<available file="${lib.win}" type="dir"/>
</and>
</condition>
<!-- Make sure we use the windows-64 natives if this is 64-bit Windows. Note
that properties are case-sensitive even if the environment variables on
the operating system are not. For example, Windows's system path
variable may be set to an Ant property "system.Path" rather than
"system.PATH". -->
<condition property="path"
value="${lib}/native/windows-64:${system.PATH}:${system.Path}">
<and>
<isset property="is.running.windows"/>
<os arch="amd64" />
</and>
</condition>
<!-- Otherwise and if this is still Windows, go for the windows natives
(i.e. os.arch==i386) -->
<condition property="path"
value="${lib}/native/windows:${system.PATH}:${system.Path}">
<isset property="is.running.windows"/>
</condition>
<!-- At last i.e. if this is not Windows, use the system PATH environment
variable -->
<property name="path" value="${system.PATH}"/>
<condition property="bundles.dest.os" value="${bundles.dest.win}">
<isset property="is.running.windows"/>
</condition>
<!-- linux specific properties -->
<condition property="is.running.linux" value="${os.name}">
<equals arg1="${os.name}" arg2="linux" casesensitive="false" trim="true"/>
</condition>
<condition property="os.lib.home" value="${lib.lin}">
<and>
<isset property="is.running.linux"/>
<available file="${lib.lin}" type="dir"/>
</and>
</condition>
<!-- make sure we use the linux-64 natives if this is a 64 bit system-->
<condition property="ld.library.path"
value="${lib}/native/linux-64:${system.LD_LIBRARY_PATH}">
<and>
<isset property="is.running.linux"/>
<os arch="amd64" />
</and>
</condition>
<!-- otherwise we go for the normal linuxnatives (i.e. os.arch==i386)-->
<condition property="ld.library.path"
value="${lib}/native/linux:${system.LD_LIBRARY_PATH}">
<isset property="is.running.linux"/>
</condition>
<condition property="bundles.dest.os" value="${bundles.dest.lin}">
<isset property="is.running.linux"/>
</condition>
<!-- solaris specific properties -->
<condition property="is.running.solaris" value="${os.name}">
<equals arg1="${os.name}" arg2="solaris" casesensitive="false" trim="true"/>
</condition>
<condition property="is.running.solaris" value="${os.name}">
<equals arg1="${os.name}" arg2="SunOS" casesensitive="false" trim="true"/>
</condition>
<condition property="os.lib.home" value="${lib}/os-specific/solaris">
<and>
<isset property="is.running.solaris"/>
<available file="${lib}/os-specific/solaris" type="dir"/>
</and>
</condition>
<condition property="ld.library.path"
value="${lib}/native/solaris:${system.LD_LIBRARY_PATH}">
<isset property="is.running.solaris"/>
</condition>
<condition property="bundles.dest.os" value="${bundles.dest.sol}">
<isset property="is.running.solaris"/>
</condition>
<!-- mac specific properties -->
<condition property="is.running.macos" value="${os.name}">
<os family="mac"/>
</condition>
<condition property="os.lib.home" value="${lib}/os-specific/mac">
<and>
<isset property="is.running.macos"/>
<available file="${lib}/os-specific/mac" type="dir"/>
</and>
</condition>
<condition property="dyld.library.path"
value="${lib}/native/mac:${system.DYLD_LIBRARY_PATH}">
<isset property="is.running.macos"/>
</condition>
<condition property="bundles.dest.os" value="${bundles.dest.mac}">
<isset property="is.running.macos"/>
</condition>
<!-- FreeBSD specific properties -->
<condition property="is.running.freebsd" value="${os.name}">
<equals arg1="${os.name}" arg2="freebsd" casesensitive="false" trim="true"/>
</condition>
<!-- make sure we use the freebsd-64 natives if this is a 64 bit system-->
<condition property="ld.library.path"
value="${lib}/native/freebsd-64:${system.LD_LIBRARY_PATH}">
<and>
<isset property="is.running.freebsd"/>
<os arch="amd64" />
</and>
</condition>
<!-- otherwise we go for the normal freebsd natives (i.e. os.arch==i386)-->
<condition property="ld.library.path"
value="${lib}/native/freebsd:${system.LD_LIBRARY_PATH}">
<isset property="is.running.freebsd"/>
</condition>
<condition property="os.lib.home" value="${lib}/os-specific/freebsd">
<and>
<isset property="is.running.freebsd"/>
<available file="${lib}/os-specific/freebsd" type="dir"/>
</and>
</condition>
<condition property="ld.library.path"
value="${lib}/native/freebsd:${system.LD_LIBRARY_PATH}">
<isset property="is.running.freebsd"/>
</condition>
<condition property="bundles.dest.os" value="${bundles.dest.freebsd}">
<isset property="is.running.freebsd"/>
</condition>
<!-- set the os.lib.home here in case it was not set before -->
<property name="os.lib.home" value="${lib}"/>
<property name="profiler.args" value="" />
<property name="profiler.bootdelegation" value="" />
<property name="profiler.autostart" value="" />
<tstamp>
<format property="build.date" pattern="dd-MM-yyyy"/>
</tstamp>
<path id="project.source.path">
<!-- refer to both main and test source files. -->
<pathelement location="${src}"/>
<pathelement location="${src2}"/>
</path>
<path id="project.class.path">
<pathelement location="${lib}"/>
<pathelement location="${bundles.dest}/sc-launcher.jar"/>
<!-- Add this bundle to the global class path as we need
the ScLogFormatter there-->
<pathelement location="${bundles.dest}/util.jar"/>
<!-- for mac specific plugins -->
<pathelement location="/System/Library/Java"/>
<!-- Include all JAR files found in lib and any of its subdirectories. -->
<fileset dir="${lib}">
<include name="*.jar"/>
<include name="installer-exclude/*.jar"/>
<include name="bundle/*.jar"/>
</fileset>
<fileset dir="${os.lib.home}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="compile.class.path">
<path refid="project.class.path"/>
<pathelement location="${dest}"/>
<!-- Add all jmf's and jdic's to the compile class path to enable
cross compilation. -->
<fileset dir="${lib}">
<include name="os-specific/**/*.jar"/>
</fileset>
</path>
<path id="debug.class.path">
<!-- used by netbeans but might be useful elsewhere. -->
<path refid="project.class.path"/>
<!-- Include all test JAR files . -->
<fileset dir="${bundles.dest}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="simple.test.class.path">
<!-- used for testing classes outside felix -->
<path refid="debug.class.path"/>
<!-- Include all test class files, even if they exist
in a jar file already. -->
<pathelement location="${dest}" />
</path>
<!-- Import installation build xml -->
<import file="${inst.resrc}/build.xml"/>
<!-- Import JNI build xml -->
<import file="${src}/native/build.xml"/>
<!-- default Ant target does nothing except print helpful options -->
<!-- Ant-external target will appear in -projecthelp output -->
<target name="ant-usage"
description="simply execute 'ant' to discover the most useful targets.">
<echo message="Useful ant commands for the Jitsi Project..." />
<echo message="'ant rebuild' for a safe clean/build sequence" />
<echo message="'ant rebuild run' for a safe clean/build/run" />
<echo message="'ant make run' for incremental build/run" />
<echo message="'ant run' to run the last build (use with care!)" />
<echo message="'ant test' to run the tests over the last build" />
<echo message="'ant rebuild test' for safe clean/build/test sequence" />
<echo message="'ant make test' for incremental build/test sequence" />
<echo message="'ant -projecthelp' for other useful build targets" />
<echo message="'ant -help' for Ant help" />
</target>
<!-- java compile -->
<target name="compile" depends="init,version,-pre-googlecontacts">
<!--internal-target- compiles the entire project source tree -->
<javac classpathref="compile.class.path" debug="true"
deprecation="true" destdir="${dest}" nowarn="false"
includeantruntime="false"
source="1.7" target="1.7" memoryMaximumSize="400M" fork="true">
<src path="${src}"/>
<src path="${src2}"/>
<include name="**/*.java" />
<exclude name="net/java/sip/communicator/launcher/*.java" />
<compilerarg line="-Xlint -Xlint:-serial -Xlint:-unchecked -Xlint:-rawtypes -Xmaxwarns ${maxwarns}"/>
</javac>
<!--
sc-launcher.jar needs to be compatible with 1.5 in order to enable
notifying the user that a higher version of the jre is necessary.
-->
<javac classpathref="compile.class.path" debug="true"
includeantruntime="false"
deprecation="true" destdir="${dest}" nowarn="false"
source="1.5" target="1.5" memoryMaximumSize="400M" fork="true">
<src path="${src}"/>
<src path="${src2}"/>
<include name="net/java/sip/communicator/launcher/*.java" />
<compilerarg line="-Xlint -Xlint:-unchecked -Xlint:-rawtypes -Xmaxwarns ${maxwarns}"/>
</javac>
</target>
<!-- clean -->
<target name="clean" depends="clean-bundle-repositories,clean-test-reports,clean-macosx"
description="Remove all generated files and prepare for a clean build.">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${dest}"/>
<fileset dir="${bundles.dest}"/>
<fileset dir="${java.doc}"/>
<fileset dir="${release}"/>
<fileset dir="${log}"/>
</delete>
</target>
<!-- clean-bundles -->
<target name="clean-bundles"
description="Remove all existing bundles">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${bundles.dest}"/>
</delete>
</target>
<!-- internal target - removes the current set of test reports, so
residual data is not left to confuse a cached browser -->
<target name="clean-test-reports">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${test.reports.dir}"/>
</delete>
</target>
<!-- internal target - removes the OSGI repositories, so that next run
recreates them -->
<target name="clean-bundle-repositories">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${bin}" erroronmissingdir="false"/>
<fileset dir="${utest.bin}" erroronmissingdir="false"/>
</delete>
</target>
<!-- resource -->
<target name="resource">
<!--internal-target- Copies all resource file to the ${dest} dir -->
<copy todir="${dest}">
<fileset dir="${src}">
<include name="**/*.jpeg"/>
<include name="**/*.wav"/>
<include name="**/*.au"/>
<include name="**/*.gif"/>
<include name="**/*.png"/>
<include name="**/*.PNG"/>
<include name="**/*.jpg"/>
<include name="**/*.xml"/>
<include name="**/*.themerc"/>
<include name="**/gtkrc"/>
<include name="**/*.css"/>
<include name="**/*.properties"/>
</fileset>
<fileset dir="${src2}">
<include name="**/*.jpeg"/>
<include name="**/*.wav"/>
<include name="**/*.au"/>
<include name="**/*.gif"/>
<include name="**/*.png"/>
<include name="**/*.jpg"/>
<include name="**/*.xml"/>
<include name="**/*.properties"/>
</fileset>
</copy>
<copy todir="${resources}">
<fileset dir="${sc.basedir}/resources">
<include name="**/*"/>
<exclude name="**/languages/**"/>
<exclude name="**/*.svg"/>
</fileset>
</copy>
</target>
<target name="native2ascii">
<!-- internal target -
convert language property files encoding from UTF-8 to ASCII,
save converted files in ${resources}/languages dir -->
<native2ascii
src="${sc.basedir}/resources/languages"
dest="${resources}/languages"
encoding="UTF-8"
includes="**/*.properties"/>
</target>
<!-- JAVADOC -->
<target name="javadoc"
description="Generates project javadoc.">
<javadoc author="true" destdir="${java.doc}" package="true"
version="true" use="true" windowtitle="Jitsi API"
classpathref="compile.class.path" source="1.6+" maxmemory="256m">
<packageset dir="${src}">
<exclude name="net/java/sip/communicator/impl/version/**"/>
<include name="**"/>
</packageset>
<tag name="todo" description="To do:"/>
<tag name="note" description="Note:"/>
<link href="${j2se_api}" />
<header>
<![CDATA[
<b> Jitsi: the OpenSource Java VoIP and Instant Messaging client. </b>
]]>
</header>
<bottom>
<![CDATA[
<font size="-1">
<a href="http://jitsi.org"> Jitsi, the OpenSource Java VoIP and Instant Messaging client. </a>
<br>
<a href="http://www.apache.org/licenses/LICENSE-2.0"> Distributable under Apache license. </a>
<br>
</font>
]]>
</bottom>
<!-- link to libjitsi and ice4j -->
<link href="http://dev.jitsi.org/libjitsi/javadoc/"/>
<link href="http://dev.jitsi.org/ice4j/javadoc/"/>
</javadoc>
</target>
<!--PACKAGE-->
<!--Copy resource files and update bundles jars. -->
<target name="package" depends="resource,native2ascii,bundles"/>
<!--MAKE-->
<target name="make" depends="clean-bundle-repositories,compile,package"
description="Incremental compile and package the project."/>
<!--REBUILD-->
<target name="rebuild" depends="clean,make"
description="Clean and make the project (including bundles).">
<echo message="ver=${sip-communicator.version}"/>
</target>
<!-- make and deploy target used in intellij idea -->
<target name="make-and-deploy"
depends="make,deploy-os-specific-bundles"
description="make and deploy target used in intellij idea"/>
<!-- Determines the Jitsi version if any-->
<target name="-pre-version" if="build.label" >
<!-- create a class that would contain our nightly build.id if any -->
<copy file="${src}/net/java/sip/communicator/impl/version/NightlyBuildID.java.tmpl"
tofile="${src}/net/java/sip/communicator/impl/version/NightlyBuildID.java"
overwrite="true"/>
<!-- set the build id according to the cruisecontrol property -->
<replace file="${src}/net/java/sip/communicator/impl/version/NightlyBuildID.java"
token="build.id" value="${build.label}"/>
<!-- set the build id according to the cruisecontrol property -->
<replace file="${src}/net/java/sip/communicator/impl/version/RevisionID.java"
token="revision.id" value="${build.label}"/>
</target>
<!-- Jitsi Version -->
<target name="version" depends="-pre-version">
<!-- Recompile ant task classes-->
<delete failonerror="false">
<fileset dir="${dest}" includes="net/java/sip/communicator/impl/version/*.class"/>
</delete>
<javac
classpathref="compile.class.path" includeantruntime="false"
destdir="${dest}" source="1.7" target="1.7">
<src path="${src}"/>
<include name="net/java/sip/communicator/impl/version/NightlyBuildID.java" />
<include name="net/java/sip/communicator/impl/version/VersionImpl.java" />
<include name="net/java/sip/communicator/impl/version/SipCommunicatorVersionTask.java" />
</javac>
<taskdef
name="sip-communicator-version"
classname="net.java.sip.communicator.impl.version.SipCommunicatorVersionTask">
<classpath>
<pathelement path="${dest}"/>
<pathelement location="${lib.noinst}/libjitsi-1.0-SNAPSHOT.jar"/>
</classpath>
</taskdef>
<sip-communicator-version property="sip-communicator.version" />
<echo message="Jitsi version ${sip-communicator.version}" />
</target>
<!--INIT-->
<target name="init" >
<mkdir dir="${dest}"/>
<mkdir dir="${doc}"/>
<mkdir dir="${java.doc}"/>
<mkdir dir="${bundles.dest}"/>
<!-- create dirs for os specific bundles -->
<mkdir dir="${bundles.dest}/os-specific"/>
<mkdir dir="${bundles.dest.mac}"/>
<mkdir dir="${bundles.dest.lin}"/>
<mkdir dir="${bundles.dest.win}"/>
<mkdir dir="${bundles.dest.freebsd}"/>
<mkdir dir="${bundles.dest.sol}"/>
<mkdir dir="${bundles.dest.android}"/>
<mkdir dir="${test.reports.dir}"/>
<mkdir dir="${test.reports.dir}/html"/>
<mkdir dir="${release}"/>
<mkdir dir="${log}"/>
</target>
<!-- - - - - - - - - - - - - - UNIT TESTING - - - - - - - - - - - - - - -->
<!--PREPARE-TESTING-ACCOUNTS-->
<target name="prepare-local-accounts">
<!--internal-target- setup testing accounts properties -->
<!-- The following local file should contain a list of protocol
account initialization properties, such as SIP server addresses
and usernames, ICQ uin-s and passwords, AIM screennames and etc.
You should create the file based on lib/account.properties.template
and set all the empty fields as indicated. -->
<available property="accounts.properties.present"
file="${test.accounts.properties.file}"/>
<fail unless="accounts.properties.present"
message="${test.accounts.properties.file} not found - did you copy the template?"/>
<property file="${test.accounts.properties.file}"/>
</target>
<!--PREPARE-TESTS-TO-BE-RUN-->
<target name="identify-test">
<!--internal-target- is a single slick defined to be run alone? -->
<condition property="test.name.known">
<!-- has a single test class has been defined? -->
<!-- e.g. ant test -Dtest.name=SlickName -->
<isset property="test.name"/>
</condition>
</target>
<target name="prepare-single-test"
depends="identify-test"
if="test.name.known">
<!--internal-target- prepare to run a single Service Impl Compatibility Kit -->
<!-- extract the simple Test class name...
Command prompt ant calls should define the property as the
simple name (without the package hierarchy),
e.g. -Dtest.name=GibberishProtocolProviderServiceLick
netbeans must format the property using the relative-path-noext
rule so that we can extract the simple name. The Felix
slick runner ONLY works with unqualified class names. -->
<basename property="short.test.name" file="${test.name}"/>
<!-- Tell the slick runner which Test class to run. (This will prevent
the default external list from being defined.) At this
stage we don't know if it will run under felix or standalone-->
<property name="net.java.sip.communicator.slick.runner.TEST_LIST"
value="${short.test.name}"/>
<property name="net.java.sip.communicator.slick.runner.SLICKLESS_TEST_LIST"
value="${short.test.name}"/>
</target>
<target name="prepare-all-tests"
depends="clean-test-reports,prepare-single-test">
<!--internal-target- prepare to run all selected Service Impl Compatibility Kits -->
<!-- load properties needed for running any/all automated tests.
n.b. the local file will select what is meant on this system by
"all tests" UNLESS a single test has already been selected. (This
is because ant will not replace a property value once set.) -->
<available property="test.properties.present"
file="${test.local.properties.file}"/>
<fail unless="test.properties.present"
message="${test.local.properties.file} not found - did you copy the template?"/>
<property file="${test.local.properties.file}"/>
<echo message="tests prepared: ${net.java.sip.communicator.slick.runner.TEST_LIST}" />
<echo message="slickless tests prepared: ${net.java.sip.communicator.slick.runner.SLICKLESS_TEST_LIST}" />
</target>
<!--RUN-TESTS-->
<target name="test"
depends="prepare-all-tests,prepare-local-accounts,deploy-os-specific-bundles"
description="Starts felix and runs selected Service Impl Compatibility Kits.">
<condition property="logging.config.file"
value="${custom.logging.config.file}"
else="${lib}/logging.properties">
<isset property="custom.logging.config.file"/>
</condition>
<!-- Do the testing itself. Note that we don't fail on error as we need
to generate an html report before leaving this target.-->
<java classname="org.apache.felix.main.Main"
fork="true"
failonerror="false"
resultproperty="test.result.code"
classpathref="project.class.path">
<!-- Tell felix to run as a test environment-->
<sysproperty key="felix.config.properties"
value="file:${lib}/felix.unit.test.properties"/>
<!-- Tell the slick runner where to store test results. -->
<sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR"
value="${test.reports.dir}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION"
value="${test.reports.dir}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_NAME"
value="schome"/>
<!-- Tell the slick runner which Test classes to run. -->
<sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
value="${net.java.sip.communicator.slick.runner.TEST_LIST}"/>
<!-- Tell the slickless runner which Test classes to run. -->
<sysproperty key="net.java.sip.communicator.slick.runner.SLICKLESS_TEST_LIST"
value="${net.java.sip.communicator.slick.runner.SLICKLESS_TEST_LIST}"/>
<!-- use a meta contact list file different to normal client. -->
<sysproperty key="net.java.sip.communicator.CONTACTLIST_FILE_NAME"
value="net.java.sip.communicator.CONTACTLIST_FILE_NAME"/>
<!-- use a configuration file different to normal client. -->
<sysproperty key="net.java.sip.communicator.CONFIGURATION_FILE_NAME"
value="net.java.sip.communicator.CONFIGURATION_FILE_NAME"/>
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
value="${logging.config.file}"/>
<!-- Tell all protocol testers their account details. -->
<syspropertyset id="accounts">
<propertyref prefix="accounts"/>
<propertyref prefix="net"/>
</syspropertyset>
<!-- Setting properties necessary for dependencies on native libs.-->
<sysproperty key="java.library.path"
path="${ld.library.path}:${path}:${dyld.library.path}"/>
<sysproperty key="jna.library.path"
path="${ld.library.path}:${path}:${dyld.library.path}"/>
<env key="LD_LIBRARY_PATH" path="${ld.library.path}"/>
<env key="PATH" path="${path}"/>
<env key="DYLD_LIBRARY_PATH" path="${dyld.library.path}"/>
<env key="DISPLAY" path=":0"/>
<!-- Disable audio support when running test, audio is not used
and the test machine has no audio device
-->
<sysproperty key="net.java.sip.communicator.service.media.DISABLE_AUDIO_SUPPORT"
value="true"/>
</java>
<!-- Generate the html report.
Run it quietly (i.e. redirect the output) because we don't won't to
see its "Build Successful" output line as users might confuse it
for a general build success while this might not be the case.-->
<echo message="Generating HTML test reports ..."/>
<java fork="true"
classname="org.apache.tools.ant.launch.Launcher"
classpath="${java.class.path}:${lib.noinst}/xalan-2.6.0.jar.ant"
failonerror="true"
output="${test.html.reports.dir}/output.txt">
<arg value="htmlreport"/>
</java>
<echo message="Done."/>
<echo/><echo/>
<echo message="Test results available in ./test-reports/html/index.html "/>
<echo/>
<!-- Check whether testing went alright and fail if not.-->
<condition property="testing.failed">
<not>
<equals arg1="0"
arg2="${test.result.code}"
casesensitive="false" trim="true"/>
</not>
</condition>
<fail if="testing.failed"/>
</target>
<!-- We use this target from within the test target in order to generate
a human readable test report. We do not directly use the htmlreport
target because we need to include xalan in the classpath before we
do.-->
<target name="htmlreport">
<junitreport todir="${test.reports.dir}">
<fileset dir="${test.reports.dir}">
<include name="SC-TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.html.reports.dir}"/>
</junitreport>
</target>
<target name="run-simple-tests"
depends="prepare-all-tests,prepare-local-accounts,deploy-os-specific-bundles"
description="runs selected non-felix tests under junit.">
<junit haltonfailure="true" fork="true">
<formatter type="brief" usefile="false"/>
<test name="net.java.sip.communicator.slick.slickless.SlicklessTests"/>
<classpath refid="simple.test.class.path" />
<!-- Tell the slickless runner which Test classes to run. -->
<sysproperty key="net.java.sip.communicator.slick.runner.SLICKLESS_TEST_LIST"
value="${net.java.sip.communicator.slick.runner.SLICKLESS_TEST_LIST}"/>
<!-- Tell the slick runner where to store test results. -->
<sysproperty key="net.java.sip.communicator.slick.runner.OUTPUT_DIR"
value="${test.reports.dir}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION"
value="${test.reports.dir}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_NAME"
value="schome"/>
<!-- use a meta contact list file different to normal client. -->
<sysproperty key="net.java.sip.communicator.CONTACTLIST_FILE_NAME"
value="net.java.sip.communicator.CONTACTLIST_FILE_NAME"/>
<!-- use a configuration file different to normal client. -->
<sysproperty key="net.java.sip.communicator.CONFIGURATION_FILE_NAME"
value="net.java.sip.communicator.CONFIGURATION_FILE_NAME"/>
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
value="${lib}/logging.properties"/>
<!-- Tell all protocol testers their account details. -->
<syspropertyset id="accounts">
<propertyref prefix="accounts"/>
<propertyref prefix="net"/>
</syspropertyset>
</junit>
</target>
<!--DEBUG-JITSI -->
<target name="debug" depends="deploy-os-specific-bundles"
description="Starts jitsi and wait for debugger to connect on port 5432">
<!-- we allow users to pass command line args using the "args" system
property. However we need to manually set tha prop to an empty
string here or otherwise the application would get an argument with
the value ${args}-->
<property name="args" value=""/>
<!-- Jitsi on Mac OS X uses a JVMTI agent to handle kAEGetURL
AppleScript events. -->
<condition property="jvmarg.line"
value="-agentlib:AEGetURLEventHandlerAgent -Xdock:name='Jitsi' -Xdock:icon='resources/images/logo/sc_logo_128x128.icns'"
else="">
<isset property="is.running.macos"/>
</condition>
<condition property="jvm.maxheapsize"
value="-Xmx256m"
else="" >
<os arch="i386" />
</condition>
<!-- forking prevents from debugging -->
<java classname="net.java.sip.communicator.launcher.SIPCommunicator"
fork="true"
failonerror="true"
classpathref="project.class.path">
<!-- Sets the charset for the messages -->
<!--sysproperty key="icq.custom.message.charset" value="windows-1252"/-->
<!-- Tell felix to run Jitsi -->
<sysproperty key="felix.config.properties"
value="file:${lib}/felix.client.run.properties"/>
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
value="${lib}/logging.properties"/>
<sysproperty key="java.net.preferIPv6Addresses"
value="${java.net.preferIPv6Addresses}"/>
<!--sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION"
value="${user.home}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_NAME"
value="schome"/-->
<sysproperty key="smack.debugEnabled"
value="${smack.debugEnabled}"/>
<!--sysproperty key="smack.debuggerClass"
value="org.jivesoftware.smack.debugger.ConsoleDebugger"/-->
<!-- Setting properties necessary for dependencies on native libs.-->
<sysproperty key="java.library.path"
path="${ld.library.path}:${path}:${dyld.library.path}"/>
<sysproperty key="jna.library.path"
path="${ld.library.path}:${path}:${dyld.library.path}"/>
<env key="LD_LIBRARY_PATH" path="${ld.library.path}"/>
<env key="PATH" path="${path}"/>
<env key="DYLD_LIBRARY_PATH" path="${dyld.library.path}"/>
<!-- pass l10n properties from ant call for
easy translation debugging -->
<sysproperty key="user.language" value="${user.language}" />
<sysproperty key="user.country" value="${user.country}" />
<sysproperty key="user.variant" value="${user.variant}" />
<!-- make sure that we automatically enable system.out when running
Jitsi from Ant-->
<arg line="--debug"/>
<!-- pass to SC args that have been specified by the user -->
<arg line="${args}"/>
<sysproperty key="org.osgi.framework.bootdelegation"
value="${profiler.bootdelegation}" />
<sysproperty key="felix.auto.start.68"
value="${profiler.autostart}" />
<jvmarg value="-Xdebug" />
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5432" />
<!-- add some eventual profiler args, prevent server-class
detection because -server uses much more memory for 32-bit OS
(64-bit always used -server) -->
<jvmarg line="${profiler.args} ${jvmarg.line}
-client ${jvm.maxheapsize}"/>
<sysproperty key="apple.laf.useScreenMenuBar" value="true" />
</java>
</target>
<!--RUN-JITSI -->
<target name="run" depends="deploy-os-specific-bundles,load-properties"
description="Starts felix and runs sip-comunicator gui (use latest build).">
<!-- we allow users to pass command line args using the "args" system
property. However we need to manually set tha prop to an empty
string here or otherwise the application would get an argument with
the value ${args}-->
<property name="args" value=""/>
<condition property="jvmarg.line"
value="-Xdock:name='${application.name}' -Xdock:icon='resources/images/logo/sc_logo_128x128.icns'"
else="">
<isset property="is.running.macos"/>
</condition>
<condition property="jvmarg.splash"
value="-splash:resources/install/resources/splash.gif"
else="">
<isset property="splashscreen.enable"/>
</condition>
<!-- Jitsi on Mac OS X uses a JVMTI agent to handle kAEGetURL
AppleScript events. To enable it use jvmarg.aegeturl property -->
<condition property="jvmarg.aegeturl"
value="-agentlib:AEGetURLEventHandlerAgent"
else="">
<isset property="aegeturl.enable"/>
</condition>
<condition property="jvm.maxheapsize"
value="-Xmx256m"
else="" >
<os arch="i386" />
</condition>
<!-- forking prevents from debugging -->
<java classname="net.java.sip.communicator.launcher.SIPCommunicator"
fork="true"
failonerror="true"
classpathref="project.class.path">
<!-- Sets the charset for the messages -->
<!--sysproperty key="icq.custom.message.charset" value="windows-1252"/-->
<!-- Tell felix to run Jitsi -->
<sysproperty key="felix.config.properties"
value="file:${lib}/felix.client.run.properties"/>
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
value="${lib}/logging.properties"/>
<sysproperty key="java.net.preferIPv6Addresses"
value="${java.net.preferIPv6Addresses}"/>
<!--sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION"
value="${user.home}"/>
<sysproperty key="net.java.sip.communicator.SC_HOME_DIR_NAME"
value="schome"/-->
<sysproperty key="smack.debugEnabled"
value="${smack.debugEnabled}"/>
<!--sysproperty key="smack.debuggerClass"
value="org.jivesoftware.smack.debugger.ConsoleDebugger"/-->
<!-- Setting properties necessary for dependencies on native libs.-->
<sysproperty key="java.library.path"
path="${ld.library.path}:${path}:${dyld.library.path}"/>
<sysproperty key="jna.library.path"
path="${ld.library.path}:${path}:${dyld.library.path}"/>
<env key="LD_LIBRARY_PATH" path="${ld.library.path}"/>
<env key="PATH" path="${path}"/>
<env key="DYLD_LIBRARY_PATH" path="${dyld.library.path}"/>
<!-- pass l10n properties from ant call for
easy translation debugging -->
<sysproperty key="user.language" value="${user.language}" />
<sysproperty key="user.country" value="${user.country}" />
<sysproperty key="user.variant" value="${user.variant}" />
<!-- make sure that we automatically enable system.out when running
Jitsi from Ant-->
<arg line="--debug"/>
<!-- pass to SC args that have been specified by the user -->
<arg line="${args}"/>
<sysproperty key="org.osgi.framework.bootdelegation"
value="${profiler.bootdelegation}" />
<sysproperty key="felix.auto.start.68"
value="${profiler.autostart}" />
<!-- add some eventual profiler args, prevent server-class
detection because -server uses much more memory for 32-bit OS
(64-bit always used -server) -->
<jvmarg line="${profiler.args} ${jvmarg.line}
-client ${jvm.maxheapsize} ${jvmarg.splash} ${jvmarg.aegeturl}"/>
<sysproperty key="apple.laf.useScreenMenuBar" value="true" />
</java>
</target>
<!--RUN-JITSI-WITH-INTEGRATED-PROFILER -->
<target name="run-with-profiler"
description="Starts felix and runs sip-comunicator gui (use latest build) with the hooked classloader."
depends="bundle-plugin-profiler4j">
<antcall target="run">
<param name="profiler.args"
value="-Xmx128m -javaagent:${lib.noinst}/profiler4j-1.0-beta3-SC.jar" />
<param name="profiler.bootdelegation"
value="net.sf.profiler4j.agent.*" />
<param name="profiler.autostart"
value="reference:file:sc-bundles/profiler4j.jar" />
</antcall>
</target>
<target name="run-v4" description="Starts SC with a preference for IPv4.">
<ant target="run">
<property name="java.net.preferIPv6Addresses" value="false"/>
</ant>
</target>
<!--PROFILE-JITSI-IN-NETBEANS-IDE -->
<target name="profile" depends="bundle-plugin-profiler4j,deploy-os-specific-bundles"
description="Profile Project">
<fail unless="netbeans.home">
This target can only run inside the NetBeans IDE.
</fail>
<nbprofiledirect>
<classpath> <pathelement location="${dest}"/> </classpath>
</nbprofiledirect>
<java classname="net.java.sip.communicator.launcher.SIPCommunicator"
fork="true"
failonerror="true"
classpathref="project.class.path">
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<!-- Tell felix to run Jitsi -->
<sysproperty key="felix.config.properties"
value="file:${lib}/felix.client.run.properties"/>
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
value="${lib}/logging.properties"/>
<sysproperty key="java.net.preferIPv6Addresses"
value="false"/>