This repository has been archived by the owner on Apr 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
/
build.xml
216 lines (193 loc) · 8.49 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
<?xml version="1.0"?>
<project name="Mconf-Mobile Automation Build" basedir=".">
<property file="local.properties" />
<property name="android.exec" value="${sdk.dir}/tools/android" />
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/>
<target name="init">
<!--echoproperties/-->
<exec executable="git">
<arg value="submodule" />
<arg value="init" />
</exec>
<exec executable="git">
<arg value="submodule" />
<arg value="update" />
</exec>
</target>
<macrodef name="build-android-lib-project">
<attribute name="dir"/>
<attribute name="params" default="" />
<sequential>
<delete file="@{dir}/build.xml" failonerror="false"/>
<exec executable="bash" dir="@{dir}" failonerror="true">
<arg value="-c" />
<arg value="${android.exec} update lib-project --path . --target android-10 @{params}" />
</exec>
<build-android dir="@{dir}" />
<ant target="debug" dir="@{dir}" />
</sequential>
</macrodef>
<macrodef name="build-android-project">
<attribute name="dir"/>
<attribute name="params" default="" />
<sequential>
<delete file="@{dir}/build.xml" failonerror="false"/>
<exec executable="bash" dir="@{dir}" failonerror="true">
<arg value="-c" />
<arg value="${android.exec} update project --name @{dir} --path . --target android-10 @{params}" />
</exec>
<build-android dir="@{dir}" />
<ant target="debug" dir="@{dir}" />
</sequential>
</macrodef>
<macrodef name="build-android">
<attribute name="dir"/>
<sequential>
<!--
# http://coderstoolbox.net/string/
# http://code.google.com/p/android/issues/detail?id=13024#c21
sed -i 's#<setup />#<setup />\n\t<path id="android.libraries.src"><path refid="project.libraries.src" /></path>\n\t<path id="android.libraries.jars"><path refid="project.libraries.jars" /></path>#g' build.xml
-->
<exec executable="bash" dir="@{dir}" failonerror="true">
<arg value="-c" />
<arg value="sed -i 's#<setup />#<setup />\n\t<path id="android.libraries.src"><path refid="project.libraries.src" /></path>\n\t<path id="android.libraries.jars"><path refid="project.libraries.jars" /></path>#g' build.xml" />
</exec>
<ant target="clean" dir="@{dir}" />
</sequential>
</macrodef>
<target name="build-sipdroid" depends="init" unless="sipdroid-built">
<property name="sipdroid-built" value="true" />
<exec executable="${ndk.dir}/ndk-build" failonerror="true" dir="sipdroid">
<arg value="-j" />
<arg value="8" />
</exec>
<build-android-lib-project dir="sipdroid" />
</target>
<target name="build-flazr" unless="flazr-built">
<property name="flazr-built" value="true" />
<ant target="dist" dir="flazr" />
</target>
<target name="test-flazr">
<ant target="compile-test" dir="flazr" />
<mkdir dir="flazr/target/temp" />
<get dest="flazr/target/temp/test.flv" src="http://www.mediacollege.com/video-gallery/testclips/20051210-w50s_56K.flv"/>
<junit printsummary="yes" haltonfailure="true" showoutput="yes">
<classpath>
<pathelement location="flazr/target/test-classes" />
<fileset dir="flazr/target/flazr/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest fork="yes">
<!--fileset dir="flazr/src/test/java">
<include name="**/*Test*.java"/>
</fileset-->
<fileset dir="flazr/target/test-classes">
<include name="**/*Test*.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="build-bbb-java" unless="bbb-java-built">
<property name="bbb-java-built" value="true" />
<ant target="dist" dir="bbb-java" />
</target>
<target name="test-bbb-java">
<ant target="test" dir="bbb-java" />
</target>
<target name="build-bbb-android-core" depends="build-sipdroid, build-bbb-java" unless="bbb-android-core-built">
<property name="bbb-android-core-built" value="true" />
<ant target="build-all" dir="bbb-android-core" antfile="jni.build.xml" />
<copy todir="bbb-android-core/libs">
<fileset dir="bbb-java/target/bbb-java/lib">
<include name="bbb-java-git.jar" />
</fileset>
<fileset dir="bbb-java/lib">
<include name="*.jar" />
</fileset>
<fileset dir="flazr/target/flazr/lib">
<include name="*.jar" />
<exclude name="slf4j*.jar" />
<exclude name="log4j*.jar" />
<exclude name="httpclient*.jar" />
<exclude name="httpcore*.jar" />
<exclude name="junit*.jar" />
</fileset>
</copy>
<build-android-lib-project dir="bbb-android-core" />
</target>
<target name="run-findbugs">
<property file="bbb-android-core/default.properties" />
<mkdir dir="reports" />
<findbugs home="${findbugs.home}" output="html" outputFile="reports/findbugs.xml">
<auxClasspath>
<pathelement location="${sdk.dir}/platforms/${target}/android.jar" />
<fileset dir="bbb-android-core/libs">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${java.home}" >
<include name="**/*.jar"/>
</fileset>
</auxClasspath>
<class location="bbb-android-core/bin" />
</findbugs>
</target>
<target name="build-bbb-android" depends="build-bbb-android-core">
<build-android-project dir="bbb-android" />
</target>
<target name="test-bbb-android" depends="build-bbb-android">
<copy todir="bbb-androidTests/libs" file="flazr/target/flazr/lib/junit-4.8.1.jar" />
<exec executable="bash" dir="bbb-androidTests" failonerror="true">
<arg value="-c" />
<arg value="${android.exec} update test-project --main ../bbb-android --path ." />
</exec>
<!--
if [ `cat build.xml | grep '<import file="compile.xml" />' | wc -l` -eq 0 ]; then sed -i 's:<property file="default.properties" />:<property file="default.properties" />\n\n <import file="compile.xml" />:g' build.xml; fi
-->
<exec executable="bash" dir="bbb-androidTests" failonerror="true">
<arg value="-c" />
<arg value="if [ `cat build.xml | grep '<import file="compile.xml" />' | wc -l` -eq 0 ]; then sed -i 's:<property file="default.properties" />:<property file="default.properties" />\n\n <import file="compile.xml" />:g' build.xml; fi" />
</exec>
<ant target="clean" dir="bbb-androidTests" />
<ant target="run-tests" dir="bbb-androidTests">
<property name="haltonerror" value="true" />
</ant>
</target>
<target name="build-mconf-mobile" depends="build-bbb-android-core">
<build-android-project dir="mconf-mobile" />
</target>
<target name="build-all" depends="build-bbb-android, build-mconf-mobile" />
<target name="test-all" depends="test-flazr, test-bbb-java, test-bbb-android" />
<target name="clean-all">
<ant target="clean" dir="flazr" />
<ant target="clean" dir="bbb-java" />
<ant target="clean" dir="sipdroid" />
<ant target="clean" dir="bbb-android-core" />
<ant target="clean" dir="bbb-android" />
<ant target="clean" dir="mconf-mobile" />
</target>
<macrodef name="release-android">
<attribute name="dir"/>
<attribute name="version"/>
<sequential>
<ant target="release" dir="@{dir}" />
<move file="@{dir}/bin/@{dir}-release.apk" tofile="@{dir}@{version}.apk" overwrite="true" />
</sequential>
</macrodef>
<target name="release" depends="clean-all, build-bbb-android-core">
<input message="Application version: " addproperty="app.version" />
<input
message="Please enter keystore password: "
addproperty="key.store.password">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<input
message="Please enter password for alias: "
addproperty="key.alias.password">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<release-android dir="bbb-android" version="${app.version}" />
<release-android dir="mconf-mobile" version="${app.version}" />
</target>
</project>