forked from jitsi/libjitsi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
276 lines (257 loc) · 9.87 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="libjitsi" 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="dest" value="classes" />
<property name="dest.test" value="test-classes" />
<property name="dist" value="dist" />
<property name="JUnit.home" value="lib/test"/>
<property name="junit.reports" value="junit-reports"/>
<property name="libjitsi.jar" value="libjitsi.jar"/>
<property name="src" value="src"/>
<property name="src.test" value="test"/>
<property name="doc" value="doc"/>
<property name="java.doc" value="${doc}/api"/>
<property name="native.libs" value="lib/native"/>
<property environment="system"/>
<maven-artifact:dependencies pathId="compile.class.path" useScope="compile">
<pom file="pom.xml" />
</maven-artifact:dependencies>
<maven-artifact:dependencies pathId="mvn.test.class.path" useScope="test">
<pom file="pom.xml" />
</maven-artifact:dependencies>
<path id="test.class.path">
<path refid="mvn.test.class.path" />
<pathelement location="${dest}" />
<pathelement location="${dest.test}" />
</path>
<condition property="build.label"
value="${label}"
else="">
<isset property="label"/>
</condition>
<!-- Import JNI build xml -->
<import file="${src}/native/build.xml"/>
<!-- Import debian build xml -->
<import file="resources/install/build-debian.xml"/>
<target
name="clean"
description="Remove all compiled/generated files and prepare for a clean compile/build.">
<delete failonerror="false" includeemptydirs="true">
<fileset file="${libjitsi.jar}" />
<fileset dir="${dest}" />
<fileset dir="${dest.test}" />
<fileset dir="${dist}" />
<fileset dir="${doc}" />
<fileset dir="${junit.reports}"/>
</delete>
</target>
<target name="compile">
<mkdir dir="${dest}" />
<javac
classpathref="compile.class.path"
debug="true"
destdir="${dest}"
fork="true"
optimize="true"
source="1.7"
target="1.7">
<src path="${src}"/>
</javac>
</target>
<target name="compile-test" depends="compile">
<mkdir dir="${dest.test}" />
<javac
classpathref="test.class.path"
debug="true"
destdir="${dest.test}"
fork="true"
optimize="true"
source="1.7"
target="1.7">
<src path="${src.test}"/>
</javac>
</target>
<target name="compile-with-g729">
<replace
file="${src}/org/jitsi/impl/neomedia/codec/EncodingConfigurationImpl.java"
token="public static final boolean G729 = false"
value="public static final boolean G729 = true"/>
<antcall target="compile" />
<replace
file="${src}/org/jitsi/impl/neomedia/codec/EncodingConfigurationImpl.java"
token="public static final boolean G729 = true"
value="public static final boolean G729 = false"/>
</target>
<!-- Use this target to build with CryptoBenchmark.java -->
<target name="compile-with-benchmark">
<mkdir dir="${dest}" />
<javac
classpathref="compile.class.path"
debug="true"
destdir="${dest}"
fork="true"
optimize="true"
source="1.7"
target="1.7">
<src path="${src}"/>
</javac>
</target>
<target name="jar" depends="compile">
<jar
compress="true"
destfile="${libjitsi.jar}">
<fileset casesensitive="no" dir="${dest}">
<include name="**/*.class" />
<include name="**/*.properties" />
<exclude name="${dest}/libjitsi.jar" />
</fileset>
</jar>
</target>
<target
name="make"
depends="compile,jar"
description="Incrementally compile and jar/package the project." />
<target
name="make-and-copy-to-jitsi"
depends="make"
description="Package the project and copy the resulting jar to Jitsi (which is assumed to live next to libjitsi).">
<copy file="${libjitsi.jar}" todir="../jitsi/lib/installer-exclude" overwrite="true"/>
</target>
<target
name="make-with-g729"
depends="compile-with-g729,jar"
description="Incrementally compile and jar/package the project including support for the G.729 audio codec." />
<target
name="rebuild"
depends="clean,make"
description="Clean and make the project." />
<!--
Run a libjitsi example from the org.jitsi.examples package by name. The name
of the example to run is to be specified as the value of the Ant property
'run.example.name'. Command-line arguments may be specified to the example
to be run via the Ant property 'run.example.arg.line'.
-->
<target
name="run-example"
depends="compile"
description="Run a libjitsi example by name.">
<java
classname="org.jitsi.examples.${run.example.name}"
failonerror="true"
fork="true">
<arg line="${run.example.arg.line}" />
<classpath>
<path refid="compile.class.path" />
<pathelement location="${dest}" />
</classpath>
<sysproperty
key="java.library.path"
path="lib/native/linux-x86-64:lib/native/linux-x86:lib/native/darwin:lib/native/win32-x86-64:lib/native/win32-x86" />
</java>
</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.7+" 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://www.apache.org/licenses/LICENSE-2.0"> Distributable under Apache license. </a>
<br>
</font>
]]>
</bottom>
</javadoc>
</target>
<!-- build all binaries and the libjitsi.jar -->
<target name="dist" depends="make">
<zip destfile="${dist}/windows/libjitsi-${build.label}-x86.zip">
<zipfileset file="libjitsi.jar" />
<zipfileset dir="lib" includes="*.jar" prefix="lib"/>
<zipfileset dir="lib/native/win32-x86" includes="*.dll"
prefix="lib/native/win32-x86"/>
</zip>
<zip destfile="${dist}/windows/libjitsi-${build.label}-x64.zip">
<zipfileset file="libjitsi.jar" />
<zipfileset dir="lib" includes="*.jar" prefix="lib"/>
<zipfileset dir="lib/native/win32-x86-64" includes="*.dll"
prefix="lib/native/win32-x86-64"/>
</zip>
<zip destfile="${dist}/macosx/libjitsi-${build.label}.zip">
<zipfileset file="libjitsi.jar" />
<zipfileset dir="lib" includes="*.jar" prefix="lib"/>
<zipfileset dir="lib/native/darwin" includes="*.jnilib"
prefix="lib/native/darwin"/>
</zip>
<zip destfile="${dist}/linux/libjitsi-${build.label}-i386.zip">
<zipfileset file="libjitsi.jar" />
<zipfileset dir="lib" includes="*.jar" prefix="lib"/>
<zipfileset dir="lib/native/linux-x86" includes="*.so"
prefix="lib/native/linux-x86"/>
</zip>
<zip destfile="${dist}/linux/libjitsi-${build.label}-amd64.zip">
<zipfileset file="libjitsi.jar" />
<zipfileset dir="lib" includes="*.jar" prefix="lib"/>
<zipfileset dir="lib/native/linux-x86-64" includes="*.so"
prefix="lib/native/linux-x86-64"/>
</zip>
<zip destfile="${dist}/src/libjitsi-src-${build.label}.zip">
<zipfileset dir="." prefix="libjitsi">
<exclude name="classes/"/>
<exclude name="dist/"/>
<exclude name=".git/"/>
<exclude name="libjitsi.jar"/>
</zipfileset>
</zip>
</target>
<!-- Run the tests-->
<target name="test" depends="compile-test">
<mkdir dir="${junit.reports}"/>
<junit printsummary="yes" haltonfailure="true" fork="true" forkmode="once">
<formatter type="xml" />
<classpath refid="test.class.path"/>
<sysproperty
key="java.library.path"
path="lib/native/linux-x86-64:lib/native/linux-x86:lib/native/darwin:lib/native/win32-x86-64:lib/native/win32-x86" />
<test name="org.jitsi.sctp4j.SctpTestSuite"
todir="${junit.reports}"/>
</junit>
</target>
<target name="copy-runtime-dependencies-from-maven">
<delete failonerror="false" includeemptydirs="true">
<fileset file="lib/*.jar" />
</delete>
<maven-artifact:dependencies filesetId="runtime.fileset" useScope="runtime">
<pom file="pom.xml" />
</maven-artifact:dependencies>
<copy todir="lib">
<fileset refid="runtime.fileset" />
<mapper type="flatten" />
</copy>
</target>
</project>