aboutsummaryrefslogtreecommitdiffstats
path: root/build.xml
blob: 59508d8a0a165ef6b66c88629a857bcc269dd6bd (plain)
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
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by Emil Ivov on Jul 6, 2005 8:30:22 PM-->

<project basedir="." default="rebuild" name="sip-communicator-1.0">

    <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="doc" value="doc"/>
    <property name="java.doc" value="${doc}/api"/>
    <property name="lib" value="lib"/>
    <property name="native.libs" value="lib/native"/>
    <property name="src" value="src"/>
    <property name="src2" value="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"/>

    <!-- windows  -->
    <condition property="jmf.home" value="${lib}/jmf-win">
        <os family="windows"/>
    </condition>
    <condition property="is.running.windows" value="${os.name}">
        <os family="windows"/>
    </condition>
    <!-- linux -->
    <condition property="jmf.home" value="${lib}/jmf-lin">
        <equals arg1="${os.name}" arg2="linux" casesensitive="false" trim="true"/>
    </condition>
    <condition property="is.running.linux" value="${os.name}">
        <equals arg1="${os.name}" arg2="linux" casesensitive="false" trim="true"/>
    </condition>
    <!-- solaris -->
    <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="jmf.home" value="${lib}/jmf-sol">
        <equals arg1="${os.name}" arg2="solaris" casesensitive="false" trim="true"/>
    </condition>
    <condition property="jmf.home" value="${lib}/jmf-sol">
        <equals arg1="${os.name}" arg2="SunOS" casesensitive="false" trim="true"/>
    </condition>


    <property name="jmf.home" value="${lib}/jmf-all"/>
    <condition property="jmf.performancepack.available" value="true">
        <not>
            <equals arg1="${jmf.home}" arg2="${lib}/jmf-all"
                casesensitive="false" trim="true"/>
        </not>
    </condition>
    <!-- end jmf.home-->

    <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="${dest}"/>

        <!-- Include all JAR files found in lib and any of its subdirectories. -->
        <fileset dir="${lib}">
            <include name="**/*.jar"/>
        </fileset>
    </path>

    <!-- java compile -->
    <target name="compile" depends="init"
        description="Runs javac on the project source tree.">
        <javac classpathref="project.class.path" debug="true"
            deprecation="true" destdir="${dest}" nowarn="false"
            source="1.4" target="1.4">
            <src path="${src}"/>
            <src path="${src2}"/>
        </javac>
    </target>

    <!-- clean -->
    <target name="clean"
        description="Remove all generated files and get ready for a clean restart.">
        <delete file="${bundles.dest}/configuration.jar"/>
        <delete file="${bundles.dest}/configuration-slick.jar"/>
        <delete failonerror="false" includeemptydirs="true">
            <fileset dir="${dest}"/>
            <fileset dir="${bundles.dest}"/>
            <fileset dir="${bin}"/>
            <fileset dir="${utest.bin}"/>
            <fileset dir="${native.libs}"/>
            <fileset dir="${java.doc}"/>
            <fileset dir="${test.reports.dir}"/>
        </delete>
    </target>

    <!-- resource -->
    <target name="resource"
        description="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="**/*.jpg"/>
                <include name="**/*.properties"/>
                <include name="**/*.xml"/>
            </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"/>
            </fileset>
        </copy>
    </target>

    <!-- JAVADOC -->
    <target name="javadoc">
        <javadoc author="true" destdir="${java.doc}" package="true"
            version="true" use="true" windowtitle="SIP Communicator API"
            classpathref="project.class.path" source="1.4+">
            <fileset dir="${src}"/>
            <tag name="todo" description="To do:"/>
        </javadoc>
    </target>

    <!--PACKAGE-->
    <target name="package"
        depends="javadoc,resource"
        description="Create java doc, and copy resource files"/>

    <!--MAKE-->
    <target name="make" depends="compile,package"
        description="compile and package the project"/>

    <!--REBUILD-->
    <target name="rebuild" depends="clean,make"
        description="clean,re-compile and package the project"/>

    <!--INIT-->
    <target name="init">
        <mkdir dir="${dest}"/>
        <mkdir dir="${doc}"/>
        <mkdir dir="${java.doc}"/>
        <mkdir dir="${bundles.dest}"/>
        <mkdir dir="${test.reports.dir}"/>

        <!-- set the jmf.performancepack.extracted property so that we know
             whether we'll have to extract jmf native libs -->
        <condition property="jmf.performancepack.extracted">
            <available file="${native.libs}"/>
        </condition>

        <ant target="extractnativejmf"/>

    </target>

    <!-- Verifies whether we have a jmf performance pack for the current
         operating system and extracts it in the lib/native directory -->
    <target name="extractnativejmf"
           if="jmf.performancepack.available"
           unless="jmf.performancepack.extracted"
           description="Verifies whether we have a jmf performance pack for
                        the current operating system and extracts it in the
                        lib/native directory">

        <echo>
            Extracting ${os.name} performance pack native libs
            from: ${jmf.home}/jmf-native.jar
            to:${native.libs}
        </echo>
        <unjar dest="${native.libs}" overwrite="true" >
            <fileset dir="${jmf.home}">
                <include name="jmf-native.jar"/>
            </fileset>
        </unjar>
    </target>

    <!-- - - - - - - - - - - - - - UNIT TESTING - - - - - - - - - - - - - - -->

    <!--PREPARE-TESTS-->
    <target name="identify-test"
            description="identifies Service Impl Compatibility Kits to run">
        <!-- has a single test class has been defined?    -->
        <condition property="test.name.known">
            <isset property="test.name"/>
        </condition>
    </target>

    <target name="prepare-single-test" depends="identify-test"
            if="test.name.known"
            description="prepares to run a single Service Impl Compatibility Kit">
        <!-- extract the simple Test class name. -->
        <basename property="simple.test.names"
                file="${test.name}" suffix=".java"/>
    </target>

    <target name="prepare-all-tests" depends="identify-test"
            unless="test.name.known"
            description="prepares to run all known Service Impl Compatibility Kits">
        <!-- assign all known Test classes. -->
        <property name="simple.test.names"
                  value="
                        ConfigurationServiceLick
                        MediaServiceLick
                        NetworkAddressManagerServiceLick
                        ResourcesServicesLick
                        HistoryServiceLick
                        SlicklessTests
                        "/>
    </target>

    <!--RUN-TESTS-->
    <target name="test" depends="init,prepare-single-test,prepare-all-tests"
        description="starts oscar and runs selected Service Impl Compatibility Kits">

        <java classname="org.ungoverned.oscar.Main"
            fork="true"
            failonerror="true"
            classpathref="project.class.path">

            <!-- The following two configure oscar telling it that it's running
                 as a test environment-->
            <sysproperty key="oscar.config.properties"
                value="file:./lib/oscar.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}"/>

            <!-- Tell the slick runner about TestSutes we've preregistered. -->
            <sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
                value="${simple.test.names}"/>

            <!-- Tell java.util.logging about our logging preferences -->
            <sysproperty key="java.util.logging.config.file"
                value="lib/logging.properties"/>

        </java>
    </target>

    <target name="cc-buildloop" depends="rebuild,bundles,test"/>
    <!-- - - NetBeans Targets for specific files selected via ide-actions - -->

    <!--netbeans only - debug a single test file under oscar and jUnit-->
    <target name="debug-selected-file"
            depends="init,init,prepare-single-test,prepare-all-tests"
            description="starts oscar and runs selected Service Impl Compatibility Kit">

      <fail unless="test.name"
            message="debug impossible when 'test.name' property not defined!" />

        <nbjpdastart name="${test.name}"
                     addressproperty="jpda.address"
                     transport="dt_socket" >
            <classpath refid="project.class.path" />
            <sourcepath refid="project.source.path" />
        </nbjpdastart>

        <java fork="true"
              classname="org.ungoverned.oscar.Main"
              classpathref="project.class.path"
              failonerror="true" >
           <jvmarg value="-Xdebug"/>
           <jvmarg value="-Xnoagent"/>
           <jvmarg value="-Djava.compiler=none"/>
           <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
           <arg value="${test.name}"/>

            <!-- The following two configure oscar telling it that it's running
                 as a test environment-->
            <sysproperty key="oscar.config.properties"
                value="file:./lib/oscar.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}"/>

            <!-- Tell the slick runner which Test class to run. -->
            <sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
                value="${simple.test.names}"/>

            <!-- Tell the slick runner which Test class to run.
            <sysproperty key="net.java.sip.communicator.slick.runner.TEST_LIST"
                value="SlicklessTests"/> -->

            <!-- Tell java.util.logging about our logging preferences -->
            <sysproperty key="java.util.logging.config.file"
                value="lib/logging.properties"/>

        </java>
    </target>


    <!-- - - - - - - - - - - - - - BUNDLE BUILDING TARGETS - - - - - - - -  - -->
    <!--ALL BUNDLES-->
    <target name="bundles"
        depends="bundle-util,bundle-configuration,bundle-history,
        bundle-history-slick,bundle-configuration-slick,bundle-netaddr,
        bundle-netaddr-slick,bundle-slickless,bundle-slick-runner,bundle-sip,
        bundle-resources,bundle-resources-slick,bundle-media,bundle-media-slick"/>
    <!--BUNDLE-HISTORY-->
    <target name="bundle-history" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/history.jar"
            manifest="src/net/java/sip/communicator/impl/history/history.manifest.mf">

            <zipfileset dir="${dest}/net/java/sip/communicator/service/history"
                prefix="net/java/sip/communicator/service/history"/>
            <zipfileset dir="${dest}/net/java/sip/communicator/impl/history"
                prefix="net/java/sip/communicator/impl/history" />

            <zipfileset dir="${dest}/net/java/sip/communicator/service/protocol"
                prefix="net/java/sip/communicator/service/protocol">
                <include name="Contact*"/>
            </zipfileset>
        </jar>
    </target>

    <!--BUNDLE-HISTORY-SLICK-->
    <target name="bundle-history-slick" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/history-slick.jar"
            manifest="test/net/java/sip/communicator/slick/history/history.slick.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/slick/history"
                prefix="net/java/sip/communicator/slick/history"/>
        </jar>
    </target>

    <!--BUNDLE-RESOURCES-->
    <target name="bundle-resources" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/resources.jar"
            manifest="src/net/java/sip/communicator/impl/resources/resources.manifest.mf">

            <zipfileset dir="${dest}/net/java/sip/communicator/service/resources"
                prefix="net/java/sip/communicator/service/resources"/>
            <zipfileset dir="${dest}/net/java/sip/communicator/impl/resources"
                prefix="net/java/sip/communicator/impl/resources" />
        </jar>
    </target>

    <!--BUNDLE-RESOURCES-SLICK-->
    <target name="bundle-resources-slick" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/resources-slick.jar"
            manifest="test/net/java/sip/communicator/slick/resources/resources.slick.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/slick/resources"
                prefix="net/java/sip/communicator/slick/resources"/>
        </jar>
    </target>

    <!--BUNDLE-UTIL-->
    <target name="bundle-util" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/util.jar"
            manifest="src/net/java/sip/communicator/util/util.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/util"
                prefix="net/java/sip/communicator/util"/>
        </jar>
    </target>

    <!--BUNDLE-CONFIGURATION-->
    <target name="bundle-configuration" depends="rebuild">
        <jar
            compress="false"
            destfile="${bundles.dest}/configuration.jar"
            manifest="src/net/java/sip/communicator/impl/configuration/configuration.manifest.mf" >

            <zipfileset dir="${dest}/net/java/sip/communicator/service/configuration"
                prefix="net/java/sip/communicator/service/configuration"/>
            <zipfileset dir="${dest}/net/java/sip/communicator/impl/configuration"
                prefix="net/java/sip/communicator/impl/configuration" />
        </jar>
    </target>

    <!--BUNDLE-CONFIGURATION-SLICK-->
    <target name="bundle-configuration-slick" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/configuration-slick.jar"
            manifest="test/net/java/sip/communicator/slick/configuration/configuration.slick.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/slick/configuration"
                prefix="net/java/sip/communicator/slick/configuration"/>
        </jar>
    </target>

    <!--BUNDLE-JUNIT -->
    <target name="bundle-junit">
        <jar compress="true" destfile="lib/bundle/junit.jar"
            manifest="test/junit/junit.manifest.mf">
            <zipfileset src="${lib}/junit.jar" prefix=""/>
        </jar>
    </target>

    <!--BUNDLE-MEDIA-->
    <target name="bundle-media" depends="rebuild">
        <jar
            compress="false" destfile="${bundles.dest}/media.jar"
            manifest="src/net/java/sip/communicator/impl/media/media.manifest.mf">

            <zipfileset dir="${dest}/net/java/sip/communicator/service/media"
                prefix="net/java/sip/communicator/service/media"/>
            <zipfileset dir="${dest}/net/java/sip/communicator/impl/media"
                prefix="net/java/sip/communicator/impl/media"/>
        </jar>
    </target>

    <!--BUNDLE-MEDIA-SLICK-->
    <target name="bundle-media-slick" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/media-slick.jar"
            manifest="test/net/java/sip/communicator/slick/media/media.slick.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/slick/media"
                prefix="net/java/sip/communicator/slick/media"/>
        </jar>
    </target>

    <!--BUNDLE-SERVICEBINDER -->
    <target name="bundle-servicebinder">
        <jar compress="true" destfile="lib/bundle/servicebinder.jar"
            filesetmanifest="merge">

            <zipfileset src="${lib}/servicebinder.jar" prefix=""/>
            <manifest>
                <attribute name="Import-Package" value="org.osgi.framework"/>
            </manifest>
        </jar>
    </target>

    <!--BUNDLE-ARCHITECTUREVIEWER -->
    <target name="bundle-architectureviewer">
        <jar compress="true" destfile="lib/bundle/architectureviewer1.1.jar"
            filesetmanifest="merge">

            <zipfileset src="${lib}/architectureviewer1.1.jar" prefix=""/>
            <manifest>
                <attribute name="Import-Package"
                    value="javax.swing,	javax.swing.text,
org.ungoverned.gravity.servicebinder, org.ungoverned.gravity.servicebinder.architecture,
javax.accessibility, javax.swing.plaf, javax.swing.tree, javax.swing.undo,
javax.swing.event, javax.swing.border"/>
            </manifest>
        </jar>
    </target>

    <!--BUNDLE-NETADDR -->
    <target name="bundle-netaddr" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/netaddr.jar"
            manifest="src/net/java/sip/communicator/impl/netaddr/netaddr.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/service/netaddr"
                prefix="net/java/sip/communicator/service/netaddr"/>
            <zipfileset dir="${dest}/net/java/sip/communicator/impl/netaddr"
                prefix="net/java/sip/communicator/impl/netaddr"/>
        </jar>
    </target>

    <!--BUNDLE-NETADDR-SLICK -->
    <target name="bundle-netaddr-slick" depends="rebuild">
        <jar compress="false" destfile="${bundles.dest}/netaddr-slick.jar"
            manifest="test/net/java/sip/communicator/slick/netaddr/netaddr.slick.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/slick/netaddr"
                prefix="net/java/sip/communicator/slick/netaddr"/>
        </jar>
    </target>

    <!--BUNDLE-SLICKLESS-->
    <target name="bundle-slickless" depends="rebuild"
        description="Runs all tests that are testing classes which do not belong to a service implementation and don't therefore need a running OSGI framework">
        <jar compress="false" destfile="${bundles.dest}/slickless.jar"
            manifest="test/net/java/sip/communicator/slick/slickless/slickless.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/slick/slickless"
                prefix="net/java/sip/communicator/slick/slickless"/>
        </jar>
    </target>

    <!--BUNDLE-SLICK-RUNNER-->
    <target name="bundle-slick-runner" depends="rebuild"
        description="Creates a bundle that runs all SLICKs that currently exist in the sip-communicator.">
        <jar compress="false" destfile="${bundles.dest}/slick-runner.jar"
            manifest="test/net/java/sip/communicator/slick/runner/slick-runner.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/slick/runner"
                prefix="net/java/sip/communicator/slick/runner"/>
        </jar>
    </target>

    <!--BUNDLE-SIP-->
    <target name="bundle-sip" depends="rebuild"
        description="Creates a bundle containing the sip implementation of the protocol provider package.">
        <jar compress="false" destfile="${bundles.dest}/protocol-sip.jar"
            manifest="src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf">
            <zipfileset dir="${dest}/net/java/sip/communicator/service/protocol"
                prefix="net/java/sip/communicator/service/protocol"/>
            <zipfileset dir="${dest}/net/java/sip/communicator/impl/protocol/sip"
                prefix="net/java/sip/communicator/impl/protocol/sip"/>
        </jar>
    </target>


</project>