forked from jitsi/jicofo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
349 lines (324 loc) · 13.2 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="jicofo" xmlns:maven-artifact="antlib:org.apache.maven.artifact.ant">
<!--
Requires maven-ant-tasks to maintain this project's dependencies in Maven's
pom.xml only and have the latter fetch them when necessary so that we don't
have to commit dependent binaries in this project's repository.
To install maven-ant-tasks locally, run the following once:
mvn dependency:get -DartifactId=maven-ant-tasks -DgroupId=org.apache.maven -Dversion=2.1.3
Then invoke Ant with the -lib command line argument pointing to the
directory which contains maven-ant-tasks as follows:
ant -lib ~/.m2/repository/org/apache/maven/maven-ant-tasks/2.1.3 [target]
-->
<property file="local.properties" />
<property name="jitsi.path" value="../jitsi" />
<property name="smack.path" value="../smack_src_3_2_2" />
<property name="src" value="src/main/java" />
<property name="src.test" value="src/test/java" />
<property name="output" value="classes" />
<property name="output.test" value="test-classes" />
<property name="run.arg.line" value="" />
<property name="run.jvmarg.line" value="" />
<property name="dist" value="dist" />
<property name="doc" value="doc"/>
<property name="java.doc" value="${doc}/api"/>
<property name="junit.reports" value="junit-reports"/>
<condition property="label" value="build.SVN">
<not>
<isset property="label"/>
</not>
</condition>
<property
name="packname.win"
value="${ant.project.name}-windows-x86-${label}"/>
<property
name="packname.win64"
value="${ant.project.name}-windows-x64-${label}"/>
<property
name="packname.lin"
value="${ant.project.name}-linux-x86-${label}"/>
<property
name="packname.lin64"
value="${ant.project.name}-linux-x64-${label}"/>
<property
name="packname.macosx"
value="${ant.project.name}-macosx-${label}"/>
<property name="packname.src" value="${ant.project.name}-src-${label}"/>
<maven-artifact:dependencies pathId="compile.classpath" useScope="compile">
<pom file="pom.xml" />
</maven-artifact:dependencies>
<maven-artifact:dependencies filesetId="runtime.fileset"
pathId="runtime.classpath" useScope="runtime">
<pom file="pom.xml" />
</maven-artifact:dependencies>
<path id="run.classpath">
<path refid="runtime.classpath" />
<pathelement location="${output}" />
</path>
<maven-artifact:dependencies pathId="test.classpath" useScope="test">
<pom file="pom.xml" />
</maven-artifact:dependencies>
<path id="run.test.classpath">
<path refid="test.classpath" />
<pathelement location="${output.test}" />
</path>
<!-- Import debian build xml -->
<import file="resources/install/build-debian.xml"/>
<target name="clean" depends="clean-release">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${output}" />
<fileset dir="${output.test}" />
<fileset dir="${dist}" />
<fileset dir="${junit.reports}" />
</delete>
</target>
<!-- Copies/Updates jitsi bundles from the jitsi project path to the
current libs folder. Copies only the bundles that are already present
in the lib/bundles folder.
-->
<target name="copy-jitsi-bundles" if="jitsi.path">
<copy todir="lib" verbose="true" overwrite="true">
<fileset dir="./${jitsi.path}/sc-bundles">
<include name="*.jar"/>
<not>
<present present="srconly" targetdir="lib"/>
</not>
</fileset>
</copy>
</target>
<target name="copy-smack">
<copy todir="lib" verbose="true" overwrite="true">
<fileset dir="${smack.path}/target/">
<include name="*.jar"/>
<not>
<present present="srconly" targetdir="lib"/>
</not>
</fileset>
</copy>
</target>
<target name="compile" depends="version">
<mkdir dir="${output}" />
<javac
classpathref="compile.classpath"
destdir="${output}"
debug="true"
fork="true"
source="1.8"
srcdir="${src}"
target="1.8" />
</target>
<target name="compile-test" depends="compile">
<mkdir dir="${output.test}" />
<javac
classpathref="test.classpath"
destdir="${output.test}"
debug="true"
fork="true"
source="1.8"
srcdir="${src.test}"
target="1.8" />
</target>
<target name="run">
<condition property="run.lib.native" value="windows-64">
<os arch="amd64" family="windows" />
</condition>
<condition property="run.lib.native" value="windows">
<os arch="i386" family="windows" />
</condition>
<condition property="run.lib.native" value="macosx">
<os family="mac" />
</condition>
<condition property="run.lib.native" value="linux-64">
<and>
<equals
arg1="${os.name}"
arg2="linux"
casesensitive="false"
trim="true"/>
<os arch="amd64" />
</and>
</condition>
<condition property="run.lib.native" value="linux">
<and>
<equals
arg1="${os.name}"
arg2="linux"
casesensitive="false"
trim="true"/>
<os arch="i386" />
</and>
</condition>
<condition
else=""
property="run.java.library.path"
value="-Djava.library.path=${basedir}/lib/native/${run.lib.native}">
<isset property="run.lib.native"/>
</condition>
<java
classname="org.jitsi.jicofo.Main"
classpathref="run.classpath"
failonerror="true"
fork="true" >
<jvmarg line="${run.java.library.path} ${run.jvmarg.line}" />
<arg line="${run.arg.line}" />
</java>
</target>
<target name="test" depends="compile-test">
<mkdir dir="${junit.reports}"/>
<junit printsummary="yes" haltonfailure="true" fork="true" forkmode="once">
<formatter type="xml" />
<classpath refid="run.test.classpath"/>
<sysproperty
key="java.library.path"
path="lib/native/linux-64:lib/native/linux:lib/native/mac:lib/native/windows-64:lib/native/windows" />
<test name="org.jitsi.jicofo.FocusTestSuite"
todir="${junit.reports}"/>
</junit>
</target>
<target name="jar" depends="compile">
<jar
compress="true"
destfile="jicofo.jar">
<fileset casesensitive="no" dir="${output}">
<include name="**/*.class" />
<include name="**/*.properties" />
<exclude name="${output}/jicofo.jar" />
</fileset>
</jar>
</target>
<target
name="make"
depends="compile,jar"
description="Incrementally compile and jar/package the project." />
<target
name="rebuild"
depends="clean,make"
description="Clean and make the project." />
<!-- Jicofo Version -->
<target name="version">
<!-- set the build id according to the cruisecontrol property -->
<replaceregexp file="${src}/org/jitsi/jicofo/version/CurrentVersionImpl.java"
match="NIGHTLY_BUILD_ID = (.+)"
replace="NIGHTLY_BUILD_ID = "${label}";"
byline="true"/>
</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.classpath" source="1.8+" maxmemory="256m">
<packageset dir="${src}">
<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://gnu.org"> Distributable under LGPL license. </a>
<br>
</font>
]]>
</bottom>
</javadoc>
</target>
<target name="dist.win" depends="copy-runtime-dependencies-from-maven,make">
<zip destfile="${dist}/windows/${packname.win}.zip">
<zipfileset file="jicofo.jar"
prefix="${packname.win}" />
<zipfileset dir="lib" prefix="${packname.win}/lib">
<exclude name="native/windows-64/**"/>
<exclude name="native/linux/**"/>
<exclude name="native/linux-64/**"/>
<exclude name="native/macosx/**"/>
</zipfileset>
<zipfileset file="resources/install/windows/jicofo.bat"
prefix="${packname.win}" />
</zip>
</target>
<target name="dist.win64" depends="copy-runtime-dependencies-from-maven,make">
<zip destfile="${dist}/windows/${packname.win64}.zip">
<zipfileset file="jicofo.jar"
prefix="${packname.win64}" />
<zipfileset dir="lib" prefix="${packname.win64}/lib">
<exclude name="native/windows/**"/>
<exclude name="native/linux/**"/>
<exclude name="native/linux-64/**"/>
<exclude name="native/macosx/**"/>
</zipfileset>
<zipfileset file="resources/install/windows-64/jicofo.bat"
prefix="${packname.win64}" />
</zip>
</target>
<target name="dist.lin" depends="copy-runtime-dependencies-from-maven,make">
<zip destfile="${dist}/linux/${packname.lin}.zip">
<zipfileset file="jicofo.jar"
prefix="${packname.lin}" />
<zipfileset dir="lib" prefix="${packname.lin}/lib">
<exclude name="native/windows-64/**"/>
<exclude name="native/linux-64/**"/>
<exclude name="native/windows/**"/>
<exclude name="native/macosx/**"/>
</zipfileset>
<zipfileset file="resources/install/linux/jicofo.sh"
prefix="${packname.lin}" filemode="755"/>
</zip>
</target>
<target name="dist.lin64" depends="copy-runtime-dependencies-from-maven,make">
<zip destfile="${dist}/linux/${packname.lin64}.zip">
<zipfileset file="jicofo.jar"
prefix="${packname.lin64}" />
<zipfileset dir="lib" prefix="${packname.lin64}/lib">
<exclude name="native/windows-64/**"/>
<exclude name="native/linux/**"/>
<exclude name="native/windows/**"/>
<exclude name="native/macosx/**"/>
</zipfileset>
<zipfileset file="resources/install/linux-64/jicofo.sh"
prefix="${packname.lin64}" filemode="755"/>
</zip>
</target>
<target name="dist.macosx" depends="copy-runtime-dependencies-from-maven,make">
<mkdir dir="${dist}/macosx" />
<zip destfile="${dist}/macosx/${packname.macosx}.zip">
<zipfileset file="jicofo.jar"
prefix="${packname.macosx}" />
<zipfileset dir="lib" prefix="${packname.macosx}/lib">
<exclude name="native/windows-64/**"/>
<exclude name="native/linux/**"/>
<exclude name="native/linux-64/**"/>
<exclude name="native/windows/**"/>
</zipfileset>
<zipfileset file="resources/install/macosx/jicofo.sh"
prefix="${packname.macosx}" filemode="755"/>
</zip>
</target>
<target name="dist.src" depends="make">
<zip destfile="${dist}/src/${packname.src}.zip">
<zipfileset dir="." prefix="${packname.src}">
<exclude name="classes/"/>
<exclude name="dist/"/>
<exclude name=".git/"/>
<exclude name="jicofo.jar"/>
</zipfileset>
</zip>
</target>
<target name="copy-runtime-dependencies-from-maven">
<delete failonerror="false" includeemptydirs="true">
<fileset file="lib/*.jar" />
</delete>
<copy todir="lib">
<fileset refid="runtime.fileset" />
<mapper type="flatten" />
</copy>
</target>
</project>