Remove completely ANT
-New build for LiblinphoneSdk -New build for LinphoneSdk -New run for Liblinphone tester -New run for Linphone tester
This commit is contained in:
parent
00914a5aaf
commit
2d5a72216e
33 changed files with 640 additions and 1494 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -49,3 +49,4 @@ WORK
|
||||||
.d
|
.d
|
||||||
google-services.json
|
google-services.json
|
||||||
gradle.properties
|
gradle.properties
|
||||||
|
.*clang*
|
||||||
|
|
11
AndroidManifestLibrary.xml
Executable file
11
AndroidManifestLibrary.xml
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest package="org.linphone"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:installLocation="auto"
|
||||||
|
android:versionCode="3253"
|
||||||
|
android:versionName="3.2.5">
|
||||||
|
|
||||||
|
<uses-sdk
|
||||||
|
android:minSdkVersion="14"
|
||||||
|
android:targetSdkVersion="23"/>
|
||||||
|
</manifest>
|
12
README.md
12
README.md
|
@ -25,9 +25,11 @@ Linphone is a free VoIP and video softphone based on the SIP protocol.
|
||||||
|
|
||||||
8. _(optional)_ To generate a libmediastreamer2 SDK zip containing a full jar and native libraries, run `make mediastreamer2-sdk`
|
8. _(optional)_ To generate a libmediastreamer2 SDK zip containing a full jar and native libraries, run `make mediastreamer2-sdk`
|
||||||
|
|
||||||
9. _(optional)_ To generate a signed apk to publish on the Google Play, run `make release`. Make sure you filled the ant.properties values for version.name, key.store and key.alias in order to correctly sign the generated apk. You also may want to create a file name ant_password.properties with the following:
|
9. _(optional)_ To generate a signed apk to publish on the Google Play, run `make release`. Make sure you filled the gradle.properties values for version.name, store file, store password, key alias and key password to correctly sign the generated apk:
|
||||||
* key.store.password=[your_password]
|
* RELEASE_STORE_FILE=""
|
||||||
* key.alias.password=[your_password]
|
* RELEASE_STORE_PASSWORD=
|
||||||
|
* RELEASE_KEY_ALIAS=
|
||||||
|
* RELEASE_KEY_PASSWORD=
|
||||||
|
|
||||||
If you don't, the passwords will be asked at the signing phase.
|
If you don't, the passwords will be asked at the signing phase.
|
||||||
|
|
||||||
|
@ -43,9 +45,9 @@ Linphone is a free VoIP and video softphone based on the SIP protocol.
|
||||||
|
|
||||||
## To create an apk with a different package name
|
## To create an apk with a different package name
|
||||||
|
|
||||||
You need to edit the custom_rules.xml file:
|
You need to edit the build.gradle file:
|
||||||
|
|
||||||
1. look for the property named "linphone.package.name" and change it value accordingly
|
1. look for the function named "getPackageName()" and change it value accordingly
|
||||||
2. also update the values in the AndroidManifest file where the comment <!-- Change package ! --> appears
|
2. also update the values in the AndroidManifest file where the comment <!-- Change package ! --> appears
|
||||||
3. change the package name also in the files: res/xml/syncadapter.xml, res/xml/contacts.xml and res/values/non_localizable_custom where <!-- Change package ! --> appears
|
3. change the package name also in the files: res/xml/syncadapter.xml, res/xml/contacts.xml and res/values/non_localizable_custom where <!-- Change package ! --> appears
|
||||||
4. run again the Makefile script by calling "make"
|
4. run again the Makefile script by calling "make"
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
source.dir=src:submodules/linphone/mediastreamer2/java/src:submodules/linphone/java/j2se:submodules/linphone/java/common:submodules/linphone/java/impl:submodules/linphone/coreapi/help/java
|
|
||||||
key.store=bc-android.keystore
|
|
||||||
key.alias=nw8000
|
|
||||||
version.name=3.1.2
|
|
117
build.gradle
117
build.gradle
|
@ -41,6 +41,26 @@ if (firebaseEnable()) {
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//// Submodule Dir /////
|
||||||
|
def submoduleDir = ['submodules/linphone/mediastreamer2/java/src',
|
||||||
|
'submodules/linphone/java/j2se',
|
||||||
|
'submodules/linphone/java/common',
|
||||||
|
'submodules/linphone/java/impl',
|
||||||
|
'submodules/linphone/coreapi/help/java']
|
||||||
|
////////////////////////
|
||||||
|
|
||||||
|
///// Exclude Files /////
|
||||||
|
def excludeFiles = []
|
||||||
|
// Exclude firebase file if not enable
|
||||||
|
if (!firebaseEnable()) {
|
||||||
|
excludeFiles.add('**/Firebase*')
|
||||||
|
println '[Push Notification] Firebase disabled'
|
||||||
|
} else {
|
||||||
|
println '[Push Notification] Firebase enabled'
|
||||||
|
}
|
||||||
|
excludeFiles.add('**/mediastream/MediastreamerActivity.java')
|
||||||
|
/////////////////////////
|
||||||
|
|
||||||
android {
|
android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
|
@ -74,48 +94,18 @@ android {
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
String firebase = ''
|
|
||||||
// Exclude firebase file if not enable
|
|
||||||
if (!firebaseEnable()) {
|
|
||||||
firebase = '**/Firebase*'
|
|
||||||
println '[Push Notification] Firebase disabled'
|
|
||||||
} else {
|
|
||||||
println '[Push Notification] Firebase enabled'
|
|
||||||
}
|
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
java.srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
def srcDirs = submoduleDir
|
||||||
'submodules/linphone/java/j2se',
|
srcDirs.addAll(['src/com',
|
||||||
'submodules/linphone/java/common',
|
'src/org'])
|
||||||
'submodules/linphone/java/impl',
|
java.srcDirs = srcDirs
|
||||||
'submodules/linphone/coreapi/help/java',
|
resources.srcDirs = srcDirs
|
||||||
'src/com',
|
aidl.srcDirs = srcDirs
|
||||||
'src/org']
|
renderscript.srcDirs = srcDirs
|
||||||
resources.srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
|
||||||
'submodules/linphone/java/j2se',
|
|
||||||
'submodules/linphone/java/common',
|
|
||||||
'submodules/linphone/java/impl',
|
|
||||||
'submodules/linphone/coreapi/help/java',
|
|
||||||
'src/com',
|
|
||||||
'src/org']
|
|
||||||
aidl.srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
|
||||||
'submodules/linphone/java/j2se',
|
|
||||||
'submodules/linphone/java/common',
|
|
||||||
'submodules/linphone/java/impl',
|
|
||||||
'submodules/linphone/coreapi/help/java',
|
|
||||||
'src/com',
|
|
||||||
'src/org']
|
|
||||||
renderscript.srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
|
||||||
'submodules/linphone/java/j2se',
|
|
||||||
'submodules/linphone/java/common',
|
|
||||||
'submodules/linphone/java/impl',
|
|
||||||
'submodules/linphone/coreapi/help/java',
|
|
||||||
'src/com',
|
|
||||||
'src/org']
|
|
||||||
res.srcDirs = ['res']
|
res.srcDirs = ['res']
|
||||||
assets.srcDirs = ['assets']
|
assets.srcDirs = ['assets']
|
||||||
jniLibs.srcDirs = ['libs']
|
jniLibs.srcDirs = ['libs']
|
||||||
|
java.excludes = excludeFiles
|
||||||
java.excludes = ['**/mediastream/MediastreamerActivity.java', firebase]
|
|
||||||
|
|
||||||
// Exclude some useless files
|
// Exclude some useless files
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
|
@ -129,44 +119,19 @@ android {
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
androidTest {
|
androidTest {
|
||||||
String firebase = ''
|
|
||||||
// Exclude firebase file if not enable
|
|
||||||
if (!firebaseEnable()) {
|
|
||||||
firebase = '**/Firebase*'
|
|
||||||
println '[Push Notification] Firebase disabled'
|
|
||||||
} else {
|
|
||||||
println '[Push Notification] Firebase enabled'
|
|
||||||
}
|
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
java.srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
def srcDirs = submoduleDir
|
||||||
'submodules/linphone/java/j2se',
|
srcDirs.addAll(['src/com',
|
||||||
'submodules/linphone/java/common',
|
'src/org',
|
||||||
'submodules/linphone/java/impl',
|
'src/androidTest'])
|
||||||
'submodules/linphone/coreapi/help/java',
|
java.srcDirs = srcDirs
|
||||||
'src']
|
resources.srcDirs = srcDirs
|
||||||
resources.srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
aidl.srcDirs = srcDirs
|
||||||
'submodules/linphone/java/j2se',
|
renderscript.srcDirs = srcDirs
|
||||||
'submodules/linphone/java/common',
|
|
||||||
'submodules/linphone/java/impl',
|
|
||||||
'submodules/linphone/coreapi/help/java',
|
|
||||||
'src']
|
|
||||||
aidl.srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
|
||||||
'submodules/linphone/java/j2se',
|
|
||||||
'submodules/linphone/java/common',
|
|
||||||
'submodules/linphone/java/impl',
|
|
||||||
'submodules/linphone/coreapi/help/java',
|
|
||||||
'src']
|
|
||||||
renderscript.srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
|
||||||
'submodules/linphone/java/j2se',
|
|
||||||
'submodules/linphone/java/common',
|
|
||||||
'submodules/linphone/java/impl',
|
|
||||||
'submodules/linphone/coreapi/help/java',
|
|
||||||
'src']
|
|
||||||
res.srcDirs = ['res']
|
res.srcDirs = ['res']
|
||||||
assets.srcDirs = ['assets']
|
assets.srcDirs = ['assets']
|
||||||
jniLibs.srcDirs = ['libs']
|
jniLibs.srcDirs = ['libs']
|
||||||
|
java.excludes = excludeFiles
|
||||||
java.excludes = ['**/mediastream/MediastreamerActivity.java', firebase]
|
|
||||||
|
|
||||||
// Exclude some useless files
|
// Exclude some useless files
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
|
@ -177,4 +142,12 @@ android {
|
||||||
debug.setRoot('build-types/debug')
|
debug.setRoot('build-types/debug')
|
||||||
release.setRoot('build-types/release')
|
release.setRoot('build-types/release')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task runApplication() {
|
||||||
|
def result = exec {
|
||||||
|
executable = 'adb'
|
||||||
|
args = ['shell', 'monkey', '-p', getPackageName(), '-c', 'android.intent.category.LAUNCHER', '1']
|
||||||
|
}
|
||||||
|
return result
|
||||||
}
|
}
|
109
build.xml
109
build.xml
|
@ -1,109 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project name="Linphone" default="help">
|
|
||||||
|
|
||||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
|
||||||
It contains the path to the SDK. It should *NOT* be checked into
|
|
||||||
Version Control Systems. -->
|
|
||||||
<property file="local.properties" />
|
|
||||||
|
|
||||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
|
||||||
'android' tool to add properties to it.
|
|
||||||
This is the place to change some Ant specific build properties.
|
|
||||||
Here are some properties you may want to change/update:
|
|
||||||
|
|
||||||
source.dir
|
|
||||||
The name of the source directory. Default is 'src'.
|
|
||||||
out.dir
|
|
||||||
The name of the output directory. Default is 'bin'.
|
|
||||||
|
|
||||||
For other overridable properties, look at the beginning of the rules
|
|
||||||
files in the SDK, at tools/ant/build.xml
|
|
||||||
|
|
||||||
Properties related to the SDK location or the project target should
|
|
||||||
be updated using the 'android' tool with the 'update' action.
|
|
||||||
|
|
||||||
This file is an integral part of the build system for your
|
|
||||||
application and should be checked into Version Control Systems.
|
|
||||||
|
|
||||||
-->
|
|
||||||
<property file="default.properties" />
|
|
||||||
<property file="ant.properties" />
|
|
||||||
<property file="ant_password.properties" />
|
|
||||||
|
|
||||||
<!-- if sdk.dir was not set from one of the property file, then
|
|
||||||
get it from the ANDROID_HOME env var.
|
|
||||||
This must be done before we load project.properties since
|
|
||||||
the proguard config can use sdk.dir -->
|
|
||||||
<property environment="env" />
|
|
||||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
|
||||||
<isset property="env.ANDROID_HOME" />
|
|
||||||
</condition>
|
|
||||||
|
|
||||||
<!-- The project.properties file is created and updated by the 'android'
|
|
||||||
tool, as well as ADT.
|
|
||||||
|
|
||||||
This contains project specific properties such as project target, and library
|
|
||||||
dependencies. Lower level build properties are stored in ant.properties
|
|
||||||
(or in .classpath for Eclipse projects).
|
|
||||||
|
|
||||||
This file is an integral part of the build system for your
|
|
||||||
application and should be checked into Version Control Systems. -->
|
|
||||||
<loadproperties srcFile="project.properties" />
|
|
||||||
|
|
||||||
<!-- quick check on sdk.dir -->
|
|
||||||
<fail
|
|
||||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
|
||||||
unless="sdk.dir"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Import per project custom build rules if present at the root of the project.
|
|
||||||
This is the place to put custom intermediary targets such as:
|
|
||||||
-pre-build
|
|
||||||
-pre-compile
|
|
||||||
-post-compile (This is typically used for code obfuscation.
|
|
||||||
Compiled code location: ${out.classes.absolute.dir}
|
|
||||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
|
||||||
-post-package
|
|
||||||
-post-build
|
|
||||||
-pre-clean
|
|
||||||
-->
|
|
||||||
<import file="custom_rules.xml" optional="true" />
|
|
||||||
|
|
||||||
<!-- Import the actual build file.
|
|
||||||
|
|
||||||
To customize existing targets, there are two options:
|
|
||||||
- Customize only one target:
|
|
||||||
- copy/paste the target into this file, *before* the
|
|
||||||
<import> task.
|
|
||||||
- customize it to your needs.
|
|
||||||
- Customize the whole content of build.xml
|
|
||||||
- copy/paste the content of the rules files (minus the top node)
|
|
||||||
into this file, replacing the <import> task.
|
|
||||||
- customize to your needs.
|
|
||||||
|
|
||||||
***********************
|
|
||||||
****** IMPORTANT ******
|
|
||||||
***********************
|
|
||||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
|
||||||
in order to avoid having your file be overridden by tools such as "android update project"
|
|
||||||
-->
|
|
||||||
<path id="android.antlibs">
|
|
||||||
<pathelement path="${sdk.dir}/tools/lib/ant-tasks.jar" />
|
|
||||||
</path>
|
|
||||||
|
|
||||||
<!-- Custom tasks -->
|
|
||||||
<taskdef resource="anttasks.properties" classpathref="android.antlibs" />
|
|
||||||
<property name="exe" value="" />
|
|
||||||
<property name="bat" value="" />
|
|
||||||
|
|
||||||
<getbuildtools name="android.build.tools.dir" verbose="${verbose}" />
|
|
||||||
<property name="aidl" location="${android.build.tools.dir}/aidl${exe}" />
|
|
||||||
<property name="aapt" location="${android.build.tools.dir}/aapt${exe}" />
|
|
||||||
<property name="dx" location="${android.build.tools.dir}/dx${bat}" />
|
|
||||||
<property name="zipalign" location="${android.build.tools.dir}/zipalign${exe}" />
|
|
||||||
|
|
||||||
<!-- version-tag: custom -->
|
|
||||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
|
||||||
|
|
||||||
</project>
|
|
110
custom_rules.xml
110
custom_rules.xml
|
@ -1,110 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project name="custom_rules">
|
|
||||||
<property name="linphone.package.name" value="org.linphone" />
|
|
||||||
|
|
||||||
<target name="-pre-build" description="Move file that is not to be compiled.">
|
|
||||||
<copy file="submodules/linphone/share/xml/lpconfig.xsd"
|
|
||||||
tofile="res/raw/lpconfig.xsd"
|
|
||||||
failonerror="false" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="partial-clean">
|
|
||||||
<delete file="bin/${ant.project.name}.ap_" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="javadoc">
|
|
||||||
<echo level="info">Generate Javadoc</echo>
|
|
||||||
<javadoc
|
|
||||||
destdir="${javadoc.dir}"
|
|
||||||
verbose="off"
|
|
||||||
use="true"
|
|
||||||
classpath="${sdk.dir}/platforms/${target}/android.jar:libs/android-support-v4.jar:libs/gcm.jar"
|
|
||||||
sourcepath="${source.dir}:gen"
|
|
||||||
linkoffline="http://developer.android.com/reference file:/${sdk.dir}/docs/reference"
|
|
||||||
stylesheetfile="${sdk.dir}/docs/assets/android-developer-docs.css">
|
|
||||||
</javadoc>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="-package-resources" depends="-crunch">
|
|
||||||
<!-- only package resources if *not* a library project -->
|
|
||||||
<do-only-if-not-library elseText="Library project: do not package resources...">
|
|
||||||
<exec executable="${aapt}" failonerror="true">
|
|
||||||
<arg value="package" />
|
|
||||||
<arg value="-f" />
|
|
||||||
<arg value="-v" />
|
|
||||||
<arg value="--version-code" />
|
|
||||||
<arg value="${version.code}" />
|
|
||||||
<arg value="--version-name" />
|
|
||||||
<arg value="${version.name}" />
|
|
||||||
<arg value="--debug-mode" />
|
|
||||||
<arg value="-m" />
|
|
||||||
<arg value="-u" />
|
|
||||||
<arg value="-J" />
|
|
||||||
<arg path="${gen.absolute.dir}" />
|
|
||||||
<arg value="-M" />
|
|
||||||
<arg path="${out.manifest.abs.file}" />
|
|
||||||
<arg value="-I" />
|
|
||||||
<arg path="${project.target.android.jar}" />
|
|
||||||
<arg value="-F" />
|
|
||||||
<arg path="${out.absolute.dir}/${resource.package.file.name}" />
|
|
||||||
<arg value="-S" />
|
|
||||||
<arg path="${resource.absolute.dir}" />
|
|
||||||
<arg value="--rename-manifest-package" />
|
|
||||||
<arg value="${linphone.package.name}" />
|
|
||||||
<arg value="--custom-package" />
|
|
||||||
<arg value="${linphone.package.name}" />
|
|
||||||
</exec>
|
|
||||||
</do-only-if-not-library>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="run">
|
|
||||||
<exec executable="adb">
|
|
||||||
<arg value="shell" />
|
|
||||||
<arg value="am" />
|
|
||||||
<arg value="start" />
|
|
||||||
<arg value="-a" />
|
|
||||||
<arg value="android.intent.action.MAIN" />
|
|
||||||
<arg value="-n" />
|
|
||||||
<arg value="${linphone.package.name}/org.linphone.LinphoneLauncherActivity" />
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="liblinphone-android-sdk">
|
|
||||||
<echo level="info">Creating library output jar file...</echo>
|
|
||||||
<property name="out.library.jar.file" location="${out.absolute.dir}/liblinphone.jar" />
|
|
||||||
<jar destfile="${out.library.jar.file}">
|
|
||||||
<fileset dir="bin/intermediates/classes/debug"
|
|
||||||
includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/tools/**/*.class"/>
|
|
||||||
<fileset dir="submodules/linphone/java" >
|
|
||||||
<include name="common/org/linphone/core/*.java"/>
|
|
||||||
<include name="j2se/org/linphone/core/*.java"/>
|
|
||||||
</fileset>
|
|
||||||
</jar>
|
|
||||||
<zip destfile="liblinphone-android-sdk-${version.name}.zip">
|
|
||||||
<zipfileset dir="libs" prefix="libs" includes="**/*.so" />
|
|
||||||
<zipfileset dir="${out.absolute.dir}" includes="liblinphone.jar" prefix="libs"/>
|
|
||||||
<zipfileset dir="libs-debug" prefix="libs-debug" includes="**/*.so" />
|
|
||||||
<zipfileset dir="${out.absolute.dir}" includes="liblinphone.jar" prefix="libs-debug"/>
|
|
||||||
</zip>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="linphone-android-sdk">
|
|
||||||
<echo level="info">Creating library output jar file...</echo>
|
|
||||||
<property name="out.library.jar.file" location="${out.absolute.dir}/linphone.jar" />
|
|
||||||
<jar destfile="${out.library.jar.file}">
|
|
||||||
<fileset dir="bin/intermediates/classes/debug"
|
|
||||||
includes="org/linphone/mediastream/**/*.class org/linphone/core/**/*.class org/linphone/**/*.class org/linphone/tools/**/*.class"/>
|
|
||||||
<fileset dir="submodules/linphone/java" >
|
|
||||||
<include name="common/org/linphone/core/*.java"/>
|
|
||||||
<include name="j2se/org/linphone/core/*.java"/>
|
|
||||||
</fileset>
|
|
||||||
</jar>
|
|
||||||
<zip destfile="linphone-android-sdk-${version.name}.zip">
|
|
||||||
<zipfileset dir="libs" prefix="libs" includes="**/*.so" />
|
|
||||||
<zipfileset dir="${out.absolute.dir}" includes="linphone.jar" prefix="libs"/>
|
|
||||||
<zipfileset dir="libs-debug" prefix="libs-debug" includes="**/*.so" />
|
|
||||||
<zipfileset dir="${out.absolute.dir}" includes="linphone.jar" prefix="libs-debug"/>
|
|
||||||
</zip>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</project>
|
|
172
deliver_sdk.sh
172
deliver_sdk.sh
|
@ -1,172 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
copy()
|
|
||||||
{
|
|
||||||
todir="$2/`dirname $1`"
|
|
||||||
echo "Copying $1 to $2/$1"
|
|
||||||
mkdir -p $todir
|
|
||||||
cp -r $1 $todir
|
|
||||||
}
|
|
||||||
|
|
||||||
androidize()
|
|
||||||
{
|
|
||||||
D=$1
|
|
||||||
mkdir -p $D/gen
|
|
||||||
|
|
||||||
# Add sources to eclipse .classpath
|
|
||||||
cat > $D/.classpath <<EOF
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="src" path="gen"/>
|
|
||||||
<classpathentry excluding="org/linphone/mediastream/MediastreamerActivity.java" kind="src" path="submodules/linphone/mediastreamer2/java/src"/>
|
|
||||||
<classpathentry kind="src" path="submodules/linphone/java/j2se"/>
|
|
||||||
<classpathentry kind="src" path="submodules/linphone/java/common"/>
|
|
||||||
<classpathentry kind="src" path="submodules/linphone/java/impl"/>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
|
||||||
<classpathentry exported="true" kind="lib" path="libs/aXMLRPC.jar"/>
|
|
||||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
|
||||||
<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
|
|
||||||
<classpathentry kind="lib" path="libs/gcm.jar"/>
|
|
||||||
<classpathentry kind="output" path="bin/classes"/>
|
|
||||||
|
|
||||||
</classpath>
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Fix package name
|
|
||||||
(
|
|
||||||
cd $D
|
|
||||||
grep -R "org.linphone.R" . -l | grep java | xargs sed -i 's/org\.linphone\.R/org\.linphone\.sdk\.R/g'
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create a basic AndroidManifest.xml
|
|
||||||
cat > $D/AndroidManifest.xml <<EOF
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="org.linphone" android:versionCode="1" android:versionName="1.0">
|
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="4"/>
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
|
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>
|
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
|
||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
|
||||||
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"></uses-permission>
|
|
||||||
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
|
|
||||||
<uses-permission android:name="android.permission.BOOT_COMPLETED"></uses-permission>
|
|
||||||
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
|
||||||
|
|
||||||
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
|
|
||||||
|
|
||||||
<application>
|
|
||||||
<activity android:name="org.linphone.TestConferenceActivity"
|
|
||||||
android:label="Conf test"
|
|
||||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
|
||||||
android:enabled="false">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name="org.linphone.core.tutorials.TutorialHelloWorldActivity"
|
|
||||||
android:label="Hello World"
|
|
||||||
android:enabled="false">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<activity android:name="org.linphone.core.tutorials.TutorialRegistrationActivity"
|
|
||||||
android:label="Registration"
|
|
||||||
android:enabled="false">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<activity android:name="org.linphone.core.tutorials.TutorialBuddyStatusActivity"
|
|
||||||
android:label="Buddy status"
|
|
||||||
android:enabled="false">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<activity android:name="org.linphone.core.tutorials.TutorialChatRoomActivity"
|
|
||||||
android:label="Chat Room"
|
|
||||||
android:enabled="false">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<activity android:name="org.mediastreamer2.test.Ring"
|
|
||||||
android:label="Ring+Echo"
|
|
||||||
android:enabled="false">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
</manifest>
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat > $D/default.properties <<EOF
|
|
||||||
target=`android list target -c | grep android | tail -n1`
|
|
||||||
EOF
|
|
||||||
|
|
||||||
mkdir -p $D/.settings
|
|
||||||
cat > $D/.settings/org.eclipse.jdt.core.prefs <<EOF
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.5
|
|
||||||
EOF
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DBASE="liblinphone-android-sdk"
|
|
||||||
D="../$DBASE"
|
|
||||||
rm -rf $D.zip $D
|
|
||||||
copy submodules/linphone/coreapi/help/java $D
|
|
||||||
copy libs $D
|
|
||||||
copy submodules/linphone/java/j2se $D
|
|
||||||
copy submodules/linphone/java/common $D
|
|
||||||
copy submodules/linphone/java/impl $D
|
|
||||||
copy submodules/linphone/mediastreamer2/java/src $D
|
|
||||||
|
|
||||||
androidize $D
|
|
||||||
|
|
||||||
echo "Creating zip $D"
|
|
||||||
(
|
|
||||||
cd ..
|
|
||||||
zip -rq liblinphone-android-sdk.zip $DBASE
|
|
||||||
rm -rf $DBASE
|
|
||||||
)
|
|
||||||
|
|
||||||
DBASE="liblinphone-android-javadoc"
|
|
||||||
D="../$DBASE.zip"
|
|
||||||
if grep -r "javadoc.dir" local.properties
|
|
||||||
then
|
|
||||||
echo "javadoc.dir already defined"
|
|
||||||
else
|
|
||||||
echo "javadoc.dir=$DBASE" >> local.properties
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Generating javadoc to $D"
|
|
||||||
ant javadoc
|
|
||||||
rm -rf $D
|
|
||||||
zip -rq $D $DBASE
|
|
||||||
rm -rf $DBASE
|
|
187
jni/Android.mk
187
jni/Android.mk
|
@ -1,187 +0,0 @@
|
||||||
# script expect linphone-root-dir variable to be set by parent !
|
|
||||||
|
|
||||||
#enable video on armv7 and x86 targets only
|
|
||||||
#since we want to modify BUILD_VIDEO and BUILD_X264 depending on platform, we need to make a copy because the
|
|
||||||
#variables given on command line take precedence over the ones defined internally.
|
|
||||||
ifeq ($(TARGET_ARCH_ABI), armeabi)
|
|
||||||
_BUILD_X264=0
|
|
||||||
_BUILD_OPENH264=0
|
|
||||||
_BUILD_VIDEO=0
|
|
||||||
else
|
|
||||||
_BUILD_X264=$(BUILD_X264)
|
|
||||||
_BUILD_OPENH264=$(BUILD_OPENH264)
|
|
||||||
_BUILD_VIDEO=$(BUILD_VIDEO)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(_BUILD_VIDEO),0)
|
|
||||||
ifeq (,$(DUMP_VAR))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
#libxml2
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/libxml2/Android.mk
|
|
||||||
|
|
||||||
ifeq ($(BUILD_ZRTP), 1)
|
|
||||||
BUILD_SRTP=1
|
|
||||||
ZRTP_C_INCLUDE= \
|
|
||||||
$(linphone-root-dir)/submodules/bzrtp/include
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_SRTP), 1)
|
|
||||||
SRTP_C_INCLUDE= \
|
|
||||||
$(linphone-root-dir)/submodules/externals/srtp \
|
|
||||||
$(linphone-root-dir)/submodules/externals/srtp/include \
|
|
||||||
$(linphone-root-dir)/submodules/externals/srtp/crypto/include
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
#sqlite
|
|
||||||
ifeq ($(BUILD_SQLITE),1)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/sqlite/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
#libupnp
|
|
||||||
ifeq ($(BUILD_UPNP),1)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/libupnp/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Speex
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/speex/Android.mk
|
|
||||||
|
|
||||||
# Gsm
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/gsm/Android.mk
|
|
||||||
|
|
||||||
# Matroska
|
|
||||||
ifeq ($(BUILD_MATROSKA), 1)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/libmatroska-c/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_BCTOOLBOX_MBEDTLS),1)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/mbedtls/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/bctoolbox/build/android/Android-mbedtls.mk
|
|
||||||
else
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/polarssl/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/bctoolbox/build/android/Android-polarssl.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(linphone-root-dir)/submodules/bctoolbox/build/android/Android-tester.mk
|
|
||||||
|
|
||||||
ifeq ($(BUILD_MEDIASTREAMER2_SDK), 0)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/antlr3/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/belle-sip/build/android/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
include $(linphone-root-dir)/submodules/linphone/oRTP/build/android/Android.mk
|
|
||||||
|
|
||||||
include $(linphone-root-dir)/submodules/linphone/mediastreamer2/build/android/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/linphone/mediastreamer2/tools/Android.mk
|
|
||||||
|
|
||||||
|
|
||||||
#tunnel
|
|
||||||
ifeq ($(BUILD_TUNNEL), 1)
|
|
||||||
include $(linphone-root-dir)/submodules/tunnel/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_SILK), 1)
|
|
||||||
ifeq (,$(DUMP_VAR))
|
|
||||||
endif
|
|
||||||
include $(linphone-root-dir)/submodules/mssilk/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_CODEC2), 1)
|
|
||||||
include $(linphone-root-dir)/submodules/mscodec2/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/codec2/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(_BUILD_VIDEO),1)
|
|
||||||
|
|
||||||
ifeq ($(_BUILD_X264),1)
|
|
||||||
ifeq (,$(DUMP_VAR))
|
|
||||||
endif
|
|
||||||
include $(linphone-root-dir)/submodules/msx264/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/x264/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(_BUILD_OPENH264),1)
|
|
||||||
ifeq (,$(DUMP_VAR))
|
|
||||||
endif
|
|
||||||
include $(linphone-root-dir)/submodules/msopenh264/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/openh264/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/ffmpeg/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/libvpx/Android.mk
|
|
||||||
|
|
||||||
|
|
||||||
endif #_BUILD_VIDEO
|
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(BUILD_ZRTP), 1)
|
|
||||||
ifeq (,$(DUMP_VAR))
|
|
||||||
endif
|
|
||||||
include $(linphone-root-dir)/submodules/bzrtp/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_SRTP), 1)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/srtp/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(linphone-root-dir)/submodules/linphone/build/android/Android.mk
|
|
||||||
|
|
||||||
_BUILD_AMR=0
|
|
||||||
ifneq ($(BUILD_AMRNB), 0)
|
|
||||||
_BUILD_AMR=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BUILD_AMRWB), 0)
|
|
||||||
_BUILD_AMR=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(_BUILD_AMR), 0)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/opencore-amr/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/msamr/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BUILD_AMRWB), 0)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/vo-amrwbenc/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BUILD_G729), 0)
|
|
||||||
include $(linphone-root-dir)/submodules/bcg729/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/bcg729/msbcg729/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BUILD_OPUS), 0)
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/opus/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
WEBRTC_BUILD_NEON_LIBS=false
|
|
||||||
|
|
||||||
# AECM
|
|
||||||
ifneq ($(BUILD_WEBRTC_AECM),0)
|
|
||||||
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
|
|
||||||
WEBRTC_BUILD_NEON_LIBS=true
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(linphone-root-dir)/submodules/mswebrtc/build/android/system_wrappers/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/mswebrtc/build/android/modules/audio_processing/utility/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/mswebrtc/build/android/modules/audio_processing/aecm/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
# iSAC
|
|
||||||
ifneq ($(BUILD_WEBRTC_ISAC),0)
|
|
||||||
# don't build for neon in x86
|
|
||||||
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
|
|
||||||
WEBRTC_BUILD_NEON_LIBS=true
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(linphone-root-dir)/submodules/mswebrtc/build/android/modules/audio_coding/codecs/isac/fix/source/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/mswebrtc/build/android/modules/audio_coding/codecs/ilbc/Android.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
# common modules for ISAC and AECM
|
|
||||||
ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC)$(BUILD_ILBC),000)
|
|
||||||
include $(linphone-root-dir)/submodules/mswebrtc/build/android/common_audio/signal_processing/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/mswebrtc/Android.mk
|
|
||||||
endif
|
|
|
@ -1,168 +0,0 @@
|
||||||
APP_PROJECT_PATH := $(call my-dir)/../
|
|
||||||
NDK_TOOLCHAIN_VERSION := 4.8
|
|
||||||
|
|
||||||
ifeq ($(BUILD_MEDIASTREAMER2_SDK),)
|
|
||||||
BUILD_MEDIASTREAMER2_SDK=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
APP_MODULES :=libspeex libgsm libortp libmediastreamer2
|
|
||||||
ifeq ($(BUILD_MEDIASTREAMER2_SDK), 0)
|
|
||||||
APP_MODULES += antlr3 libbellesip liblinphone liblpxml2
|
|
||||||
endif
|
|
||||||
|
|
||||||
#default values:
|
|
||||||
|
|
||||||
ifeq ($(BUILD_AMRNB),)
|
|
||||||
BUILD_AMRNB=light
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_AMRWB),)
|
|
||||||
BUILD_AMRWB=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_SRTP),)
|
|
||||||
BUILD_SRTP=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_X264),)
|
|
||||||
BUILD_X264=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_OPENH264),)
|
|
||||||
BUILD_OPENH264=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_G729),)
|
|
||||||
BUILD_G729=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_CODEC2),)
|
|
||||||
BUILD_CODEC2=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_VIDEO),)
|
|
||||||
BUILD_VIDEO=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_MEDIASTREAMER2_SDK), 0)
|
|
||||||
#sqlite
|
|
||||||
ifeq ($(BUILD_SQLITE),1)
|
|
||||||
APP_MODULES += liblinsqlite
|
|
||||||
endif
|
|
||||||
|
|
||||||
#uPnp
|
|
||||||
ifeq ($(BUILD_UPNP),1)
|
|
||||||
APP_MODULES += libupnp
|
|
||||||
endif
|
|
||||||
|
|
||||||
APP_MODULES +=bctoolbox bctoolbox_tester
|
|
||||||
ifeq ($(BUILD_TLS),1)
|
|
||||||
ifeq ($(BUILD_BCTOOLBOX_MBEDTLS),1)
|
|
||||||
APP_MODULES +=mbedtls
|
|
||||||
else
|
|
||||||
APP_MODULES +=polarssl
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_VIDEO),1)
|
|
||||||
APP_MODULES += libffmpeg-linphone
|
|
||||||
APP_MODULES += libvpx
|
|
||||||
ifeq ($(BUILD_X264),1)
|
|
||||||
APP_MODULES +=libx264 libmsx264
|
|
||||||
endif
|
|
||||||
ifeq ($(BUILD_OPENH264),1)
|
|
||||||
APP_MODULES += libopenh264 libmsopenh264
|
|
||||||
endif
|
|
||||||
ifeq ($(BUILD_MATROSKA), 1)
|
|
||||||
APP_MODULES += libmatroska2
|
|
||||||
endif
|
|
||||||
endif # BUILD_VIDEO
|
|
||||||
|
|
||||||
_BUILD_AMR=0
|
|
||||||
ifneq ($(BUILD_AMRNB), 0)
|
|
||||||
_BUILD_AMR=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BUILD_AMRWB), 0)
|
|
||||||
_BUILD_AMR=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(_BUILD_AMR), 0)
|
|
||||||
APP_MODULES += libopencoreamr libmsamr
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BUILD_AMRWB), 0)
|
|
||||||
APP_MODULES += libvoamrwbenc
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_SILK),1)
|
|
||||||
APP_MODULES +=libmssilk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_G729),1)
|
|
||||||
APP_MODULES +=libbcg729 libmsbcg729
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BUILD_OPUS), 0)
|
|
||||||
APP_MODULES += libopus
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_ILBC), 1)
|
|
||||||
APP_MODULES += libwebrtc_spl libwebrtc_ilbc libmswebrtc
|
|
||||||
ifneq (,$(findstring armeabi,$(TARGET_ARCH_ABI)))
|
|
||||||
APP_MODULES += libwebrtc_spl_neon
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(BUILD_WEBRTC_AECM), 0)
|
|
||||||
APP_MODULES += libwebrtc_system_wrappers libwebrtc_spl libwebrtc_apm_utility libwebrtc_aecm libmswebrtc
|
|
||||||
ifneq (,$(findstring armeabi,$(TARGET_ARCH_ABI)))
|
|
||||||
APP_MODULES += libwebrtc_spl_neon libwebrtc_aecm_neon
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_WEBRTC_ISAC), 1)
|
|
||||||
APP_MODULES += libwebrtc_spl libwebrtc_isacfix libmswebrtc
|
|
||||||
ifneq (,$(findstring armeabi,$(TARGET_ARCH_ABI)))
|
|
||||||
APP_MODULES += libwebrtc_spl_neon libwebrtc_isacfix_neon
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_MEDIASTREAMER2_SDK), 0)
|
|
||||||
ifeq ($(RING),yes)
|
|
||||||
APP_MODULES += libring
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_TUNNEL), 1)
|
|
||||||
APP_MODULES += libtunnelclient
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_ZRTP), 1)
|
|
||||||
APP_MODULES += libbzrtp
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_CODEC2), 1)
|
|
||||||
APP_MODULES +=libcodec2 libmscodec2
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BUILD_SRTP), 1)
|
|
||||||
APP_MODULES += libsrtp
|
|
||||||
endif
|
|
||||||
|
|
||||||
linphone-root-dir:=$(APP_PROJECT_PATH)
|
|
||||||
|
|
||||||
APP_BUILD_SCRIPT:=$(call my-dir)/Android.mk
|
|
||||||
APP_PLATFORM := android-8
|
|
||||||
APP_ABI := armeabi-v7a
|
|
||||||
ifeq ($(BUILD_FOR_ARM), 1)
|
|
||||||
APP_ABI += armeabi
|
|
||||||
endif
|
|
||||||
ifeq ($(BUILD_FOR_X86), 1)
|
|
||||||
APP_ABI += x86
|
|
||||||
endif
|
|
||||||
|
|
||||||
APP_CFLAGS += -Werror -Wall -Wno-strict-aliasing -Wno-unused-function
|
|
||||||
# Thanks cpufeature.c imported from the NDK...
|
|
||||||
APP_CFLAGS += -Wno-unused-variable
|
|
102
libLinphoneAndroidSdk.gradle
Normal file
102
libLinphoneAndroidSdk.gradle
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
// Project information
|
||||||
|
buildDir = 'bin'
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:2.3.0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile fileTree(dir: 'libs', include: 'commons-compress-1.11.jar')
|
||||||
|
}
|
||||||
|
|
||||||
|
def submoduleDir = ['submodules/linphone/mediastreamer2/java/src',
|
||||||
|
'submodules/linphone/java/j2se',
|
||||||
|
'submodules/linphone/java/common',
|
||||||
|
'submodules/linphone/java/impl',
|
||||||
|
'submodules/linphone/coreapi/help/java']
|
||||||
|
|
||||||
|
android {
|
||||||
|
defaultConfig {
|
||||||
|
compileSdkVersion 23
|
||||||
|
buildToolsVersion "25.0.2"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
lintOptions {
|
||||||
|
checkReleaseBuilds false
|
||||||
|
// Or, if you prefer, you can continue to check for errors in release builds,
|
||||||
|
// but continue the build even when errors are found:
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
manifest.srcFile 'AndroidManifestLibrary.xml'
|
||||||
|
java.srcDirs = submoduleDir
|
||||||
|
resources.srcDirs = submoduleDir
|
||||||
|
aidl.srcDirs = submoduleDir
|
||||||
|
renderscript.srcDirs = submoduleDir
|
||||||
|
jniLibs.srcDirs = ['libs']
|
||||||
|
|
||||||
|
java.excludes = ['**/mediastream/MediastreamerActivity.java']
|
||||||
|
|
||||||
|
// Exclude some useless files
|
||||||
|
packagingOptions {
|
||||||
|
exclude '**/gdb.*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
debug.setRoot('build-types/debug')
|
||||||
|
release.setRoot('build-types/release')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
libraryVariants.all { variant ->
|
||||||
|
def appName = "liblinphone-android-sdk"
|
||||||
|
variant.outputs.each { output ->
|
||||||
|
def newSdkName = "bin/outputs/aar/${appName}.aar"
|
||||||
|
output.outputFile = new File(newSdkName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////// Task /////////////
|
||||||
|
|
||||||
|
task(releaseJavadoc, type: Javadoc, dependsOn: "assembleRelease") {
|
||||||
|
source = submoduleDir
|
||||||
|
excludes = ['**/mediastream/MediastreamerActivity.java',
|
||||||
|
'**/**.html',
|
||||||
|
'**/**.aidl']
|
||||||
|
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
||||||
|
classpath += files(android.libraryVariants.release.javaCompile.classpath.files)
|
||||||
|
}
|
||||||
|
|
||||||
|
task sourcesJar(type: Jar) {
|
||||||
|
classifier = 'sources'
|
||||||
|
from android.sourceSets.main.java.srcDirs
|
||||||
|
}
|
||||||
|
|
||||||
|
task androidJavadocsJar(type: Jar, dependsOn: releaseJavadoc) {
|
||||||
|
classifier = 'javadoc'
|
||||||
|
from releaseJavadoc.destinationDir
|
||||||
|
}
|
||||||
|
|
||||||
|
task sdkZip(type: Zip) {
|
||||||
|
String appName = "linphone-android-sdk"
|
||||||
|
String gitSha = 'git describe --always'.execute().text.trim()
|
||||||
|
String newSdkName = appName + "-" + gitSha + ".zip"
|
||||||
|
|
||||||
|
from('bin/libs',
|
||||||
|
'bin/outputs/aar')
|
||||||
|
include '*'
|
||||||
|
archiveName newSdkName
|
||||||
|
}
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:debuggable="true"
|
|
||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme" >
|
android:theme="@style/AppTheme" >
|
||||||
|
|
|
@ -1,30 +1,23 @@
|
||||||
ANDROID_MOST_RECENT_TARGET=$(shell android list target -c | grep -E 'android-[0-9]+' | tail -n1)
|
all: copy-files
|
||||||
SDK_PLATFORM_TOOLS_PATH=$(shell dirname `which adb`)
|
|
||||||
|
|
||||||
all: update-project copy-files
|
|
||||||
../gradlew clean
|
../gradlew clean
|
||||||
../gradlew uninstallDebug
|
../gradlew uninstallDebug
|
||||||
../gradlew installDebug
|
|
||||||
|
|
||||||
run-all-tests: all
|
run-all-tests: all
|
||||||
ant test
|
../gradlew installDebug
|
||||||
|
$(shell adb shell am instrument -r -w org.linphone.tester/org.linphone.tester.TestRunner | tee report.txt)
|
||||||
update-project:
|
|
||||||
android update project --path . --target $(ANDROID_MOST_RECENT_TARGET)
|
|
||||||
|
|
||||||
copy-libs:
|
copy-libs:
|
||||||
rm -rf libs/armeabi
|
rm -rf libs/arm64-v8a
|
||||||
mkdir -p assets/config_files
|
if test -d "../liblinphone-sdk/android-arm64"; then \
|
||||||
if test -d "../liblinphone-sdk/android-arm"; then \
|
mkdir -p libs/arm64-v8a && \
|
||||||
mkdir -p libs/armeabi && \
|
cp -f ../liblinphone-sdk/android-arm64/lib/libgnustl_shared.so libs/arm64-v8a && \
|
||||||
cp -f ../liblinphone-sdk/android-arm/lib/libgnustl_shared.so libs/armeabi && \
|
cp -f ../liblinphone-sdk/android-arm64/lib/lib*-arm64-v8a.so libs/arm64-v8a && \
|
||||||
cp -f ../liblinphone-sdk/android-arm/lib/lib*-armeabi.so libs/armeabi && \
|
cp -f ../liblinphone-sdk/android-arm64/lib/mediastreamer/plugins/*.so libs/arm64-v8a && \
|
||||||
cp -f ../liblinphone-sdk/android-arm/lib/mediastreamer/plugins/*.so libs/armeabi && \
|
cp -f ../liblinphone-sdk/android-arm64/share/linphone/rootca.pem assets/config_files; \
|
||||||
cp -f ../liblinphone-sdk/android-arm/share/linphone/rootca.pem assets/config_files; \
|
|
||||||
fi
|
fi
|
||||||
if test -f "../liblinphone-sdk/android-arm/bin/gdbserver"; then \
|
if test -f "../liblinphone-sdk/android-arm64/bin/gdbserver"; then \
|
||||||
cp -f ../liblinphone-sdk/android-arm/bin/gdbserver libs/armeabi && \
|
cp -f ../liblinphone-sdk/android-arm64/bin/gdbserver libs/arm64-v8a && \
|
||||||
cp -f ../liblinphone-sdk/android-arm/bin/gdb.setup libs/armeabi; \
|
cp -f ../liblinphone-sdk/android-arm64/bin/gdb.setup libs/arm64-v8a; \
|
||||||
fi
|
fi
|
||||||
rm -rf libs/armeabi-v7a
|
rm -rf libs/armeabi-v7a
|
||||||
if test -d "../liblinphone-sdk/android-armv7"; then \
|
if test -d "../liblinphone-sdk/android-armv7"; then \
|
||||||
|
@ -63,6 +56,3 @@ copy-files: ../submodules/linphone/tester/tester_hosts ../submodules/linphone/te
|
||||||
cp -rf ../submodules/linphone/tester/rcfiles assets/config_files
|
cp -rf ../submodules/linphone/tester/rcfiles assets/config_files
|
||||||
cp -rf ../submodules/linphone/tester/sounds assets/config_files
|
cp -rf ../submodules/linphone/tester/sounds assets/config_files
|
||||||
cp -rf ../submodules/linphone/tester/vcards assets/config_files
|
cp -rf ../submodules/linphone/tester/vcards assets/config_files
|
||||||
if [ -a ../google-services.json ] ; \
|
|
||||||
then cp ../google-services.json . ; \
|
|
||||||
fi;
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
source.dir=src:../submodules/linphone/mediastreamer2/java/src:../submodules/linphone/java/j2se:../submodules/linphone/java/common:../submodules/linphone/java/impl
|
|
||||||
test.runner=com.zutubi.android.junitreport.JUnitReportTestRunner
|
|
|
@ -5,39 +5,24 @@ def getPackageName() {
|
||||||
return "org.linphone.tester"
|
return "org.linphone.tester"
|
||||||
}
|
}
|
||||||
|
|
||||||
def firebaseEnable() {
|
|
||||||
File googleFile = new File('google-services.json')
|
|
||||||
return googleFile.exists()
|
|
||||||
}
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
File googleFile = new File('google-services.json')
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:2.2.2'
|
classpath 'com.android.tools.build:gradle:2.3.0'
|
||||||
if (googleFile.exists()) {
|
|
||||||
classpath 'com.google.gms:google-services:3.0.0'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
if (firebaseEnable()) {
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
compile project(":libLinphoneAndroidSdk")
|
||||||
compile fileTree(dir: 'libs', include: '*.jar')
|
compile fileTree(dir: 'libs', include: '*.jar')
|
||||||
if (firebaseEnable()) {
|
androidTestCompile project(":libLinphoneAndroidSdk")
|
||||||
compile 'com.google.firebase:firebase-messaging:9.0.0'
|
androidTestCompile fileTree(dir: 'libs', include: '*.jar')
|
||||||
} else {
|
|
||||||
compile 'com.android.support:support-v4:+'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -46,30 +31,44 @@ android {
|
||||||
buildToolsVersion "25.0.2"
|
buildToolsVersion "25.0.2"
|
||||||
applicationId getPackageName()
|
applicationId getPackageName()
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
ndk {
|
||||||
|
ldLibs "log"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
String firebase = ''
|
|
||||||
// Exclude firebase file if not enable
|
|
||||||
if (!firebaseEnable()) {
|
|
||||||
firebase = '**/Firebase*'
|
|
||||||
println '[Push Notification] Firebase disabled'
|
|
||||||
} else {
|
|
||||||
println '[Push Notification] Firebase enabled'
|
|
||||||
}
|
|
||||||
|
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
java.srcDirs = ['../submodules/linphone/mediastreamer2/java/src','../submodules/linphone/java/j2se','../submodules/linphone/java/common','../submodules/linphone/java/impl','../submodules/externals/axmlrpc/src/main/java','../submodules/linphone/coreapi/help/java','src']
|
java.srcDirs = ['src']
|
||||||
resources.srcDirs = ['../submodules/linphone/mediastreamer2/java/src','../submodules/linphone/java/j2se','../submodules/linphone/java/common','../submodules/linphone/java/impl','../submodules/externals/axmlrpc/src/main/java','../submodules/linphone/coreapi/help/java','src']
|
resources.srcDirs = ['src']
|
||||||
aidl.srcDirs = ['../submodules/linphone/mediastreamer2/java/src','../submodules/linphone/java/j2se','../submodules/linphone/java/common','../submodules/linphone/java/impl','../submodules/externals/axmlrpc/src/main/java','../submodules/linphone/coreapi/help/java','src']
|
aidl.srcDirs = ['src']
|
||||||
renderscript.srcDirs = ['../submodules/linphone/mediastreamer2/java/src','../submodules/linphone/java/j2se','../submodules/linphone/java/common','../submodules/linphone/java/impl','../submodules/externals/axmlrpc/src/main/java','../submodules/linphone/coreapi/help/java','src']
|
renderscript.srcDirs = ['src']
|
||||||
res.srcDirs = ['res']
|
res.srcDirs = ['res']
|
||||||
assets.srcDirs = ['assets']
|
assets.srcDirs = ['assets']
|
||||||
jniLibs.srcDir 'libs'
|
jniLibs.srcDir 'libs'
|
||||||
|
|
||||||
java.exclude firebase
|
// Exclude some useless files
|
||||||
|
packagingOptions {
|
||||||
|
exclude '**/gdb.*'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
debug.setRoot('build-types/debug')
|
||||||
|
release.setRoot('build-types/release')
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
androidTest {
|
||||||
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
|
java.srcDirs = ['src']
|
||||||
|
resources.srcDirs = ['src']
|
||||||
|
aidl.srcDirs = ['src']
|
||||||
|
renderscript.srcDirs = ['src']
|
||||||
|
res.srcDirs = ['res']
|
||||||
|
assets.srcDirs = ['assets']
|
||||||
|
jniLibs.srcDir 'libs'
|
||||||
|
}
|
||||||
|
debug.setRoot('build-types/debug')
|
||||||
|
release.setRoot('build-types/release')
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
|
|
|
@ -1,92 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project name="liblinphone_tester" default="help">
|
|
||||||
|
|
||||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
|
||||||
It contains the path to the SDK. It should *NOT* be checked into
|
|
||||||
Version Control Systems. -->
|
|
||||||
<property file="local.properties" />
|
|
||||||
|
|
||||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
|
||||||
'android' tool to add properties to it.
|
|
||||||
This is the place to change some Ant specific build properties.
|
|
||||||
Here are some properties you may want to change/update:
|
|
||||||
|
|
||||||
source.dir
|
|
||||||
The name of the source directory. Default is 'src'.
|
|
||||||
out.dir
|
|
||||||
The name of the output directory. Default is 'bin'.
|
|
||||||
|
|
||||||
For other overridable properties, look at the beginning of the rules
|
|
||||||
files in the SDK, at tools/ant/build.xml
|
|
||||||
|
|
||||||
Properties related to the SDK location or the project target should
|
|
||||||
be updated using the 'android' tool with the 'update' action.
|
|
||||||
|
|
||||||
This file is an integral part of the build system for your
|
|
||||||
application and should be checked into Version Control Systems.
|
|
||||||
|
|
||||||
-->
|
|
||||||
<property file="ant.properties" />
|
|
||||||
|
|
||||||
<!-- if sdk.dir was not set from one of the property file, then
|
|
||||||
get it from the ANDROID_HOME env var.
|
|
||||||
This must be done before we load project.properties since
|
|
||||||
the proguard config can use sdk.dir -->
|
|
||||||
<property environment="env" />
|
|
||||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
|
||||||
<isset property="env.ANDROID_HOME" />
|
|
||||||
</condition>
|
|
||||||
|
|
||||||
<!-- The project.properties file is created and updated by the 'android'
|
|
||||||
tool, as well as ADT.
|
|
||||||
|
|
||||||
This contains project specific properties such as project target, and library
|
|
||||||
dependencies. Lower level build properties are stored in ant.properties
|
|
||||||
(or in .classpath for Eclipse projects).
|
|
||||||
|
|
||||||
This file is an integral part of the build system for your
|
|
||||||
application and should be checked into Version Control Systems. -->
|
|
||||||
<loadproperties srcFile="project.properties" />
|
|
||||||
|
|
||||||
<!-- quick check on sdk.dir -->
|
|
||||||
<fail
|
|
||||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
|
||||||
unless="sdk.dir"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Import per project custom build rules if present at the root of the project.
|
|
||||||
This is the place to put custom intermediary targets such as:
|
|
||||||
-pre-build
|
|
||||||
-pre-compile
|
|
||||||
-post-compile (This is typically used for code obfuscation.
|
|
||||||
Compiled code location: ${out.classes.absolute.dir}
|
|
||||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
|
||||||
-post-package
|
|
||||||
-post-build
|
|
||||||
-pre-clean
|
|
||||||
-->
|
|
||||||
<import file="custom_rules.xml" optional="true" />
|
|
||||||
|
|
||||||
<!-- Import the actual build file.
|
|
||||||
|
|
||||||
To customize existing targets, there are two options:
|
|
||||||
- Customize only one target:
|
|
||||||
- copy/paste the target into this file, *before* the
|
|
||||||
<import> task.
|
|
||||||
- customize it to your needs.
|
|
||||||
- Customize the whole content of build.xml
|
|
||||||
- copy/paste the content of the rules files (minus the top node)
|
|
||||||
into this file, replacing the <import> task.
|
|
||||||
- customize to your needs.
|
|
||||||
|
|
||||||
***********************
|
|
||||||
****** IMPORTANT ******
|
|
||||||
***********************
|
|
||||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
|
||||||
in order to avoid having your file be overridden by tools such as "android update project"
|
|
||||||
-->
|
|
||||||
<!-- version-tag: 1 -->
|
|
||||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,88 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project name="custom_rules" xmlns:unless="ant:unless">
|
|
||||||
<target name="run">
|
|
||||||
<exec executable="adb">
|
|
||||||
<arg value="shell" />
|
|
||||||
<arg value="am" />
|
|
||||||
<arg value="start" />
|
|
||||||
<arg value="-a" />
|
|
||||||
<arg value="android.intent.action.MAIN" />
|
|
||||||
<arg value="-n" />
|
|
||||||
<arg value="org.linphone.tester/org.linphone.tester.MainActivity" />
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
<target name="test">
|
|
||||||
<property name="output.file" value="./tests.output" />
|
|
||||||
<tstamp>
|
|
||||||
<format property="archive.name" pattern="'liblinphonetester_'yyyyMMdd_HHmmss" />
|
|
||||||
</tstamp>
|
|
||||||
<echo>Adb log files are put in ${archive.name}.zip</echo>
|
|
||||||
|
|
||||||
<exec executable="adb" >
|
|
||||||
<arg value="logcat" />
|
|
||||||
<arg value="-c" />
|
|
||||||
</exec>
|
|
||||||
<exec executable="./adb-log-start.sh" >
|
|
||||||
<arg value=" ${archive.name}" />
|
|
||||||
</exec>
|
|
||||||
<exec executable="bash">
|
|
||||||
<arg value="-c"/>
|
|
||||||
<!-- use 'tee' command to write in file AND on stdout.
|
|
||||||
First is used below to check if tests failed or not while second
|
|
||||||
is used to get output in real time -->
|
|
||||||
<arg value="adb shell am instrument -r -w org.linphone.tester/org.linphone.tester.TestRunner | tee ${output.file}"/>
|
|
||||||
</exec>
|
|
||||||
<exec executable="bash" >
|
|
||||||
<arg value="-c" />
|
|
||||||
<arg value="kill `cat adb.pid`" />
|
|
||||||
</exec>
|
|
||||||
<condition property="has.crashed" >
|
|
||||||
<or>
|
|
||||||
<resourcecontains resource="${output.file}" substring="Process crashed" />
|
|
||||||
<resourcecontains resource="${output.file}" substring="Native crash" />
|
|
||||||
<resourcecontains resource="${output.file}" substring="longMsg=junit.framework.AssertionFailedError: View with id: '" />
|
|
||||||
<resourcecontains resource="${output.file}" substring="longMsg=java.lang.RuntimeException:" />
|
|
||||||
<resourcecontains resource="${output.file}" substring="longMsg=java.lang.NullPointerException:" />
|
|
||||||
<resourcecontains resource="${output.file}" substring="android.util.AndroidException: INSTRUMENTATION_FAILED:" />
|
|
||||||
</or>
|
|
||||||
</condition>
|
|
||||||
<exec executable="bash" unless:set="has.crashed">
|
|
||||||
<arg value="-c"/>
|
|
||||||
<arg value="adb shell cat /data/data/org.linphone.tester/files/junit-report.xml > liblinphone-junit-report.xml"/>
|
|
||||||
</exec>
|
|
||||||
|
|
||||||
<zip destfile="${archive.name}.zip">
|
|
||||||
<fileset dir="." includes="${archive.name}"/>
|
|
||||||
</zip>
|
|
||||||
|
|
||||||
<antcall target="check-for-crash"/>
|
|
||||||
|
|
||||||
<fail message="Tests failed" status="42">
|
|
||||||
<condition>
|
|
||||||
<resourcecontains resource="${output.file}" substring="FAILURES" />
|
|
||||||
</condition>
|
|
||||||
</fail>
|
|
||||||
<delete file="${archive.name}"/>
|
|
||||||
<delete file="${output.file}"/>
|
|
||||||
</target>
|
|
||||||
<target name="check-for-crash" if="has.crashed">
|
|
||||||
<exec executable="adb" outputproperty="arch">
|
|
||||||
<arg value="shell"/>
|
|
||||||
<arg value="getprop" />
|
|
||||||
<arg value="ro.product.cpu.abi"/>
|
|
||||||
</exec>
|
|
||||||
<exec executable="bash" outputproperty="abi">
|
|
||||||
<arg value="-c"/>
|
|
||||||
<arg value="echo ${arch} | tr -d '\r'"/>
|
|
||||||
</exec>
|
|
||||||
<exec executable="bash" >
|
|
||||||
<arg value="-c" />
|
|
||||||
<arg value="tail -n 500 ${archive.name}" />
|
|
||||||
</exec>
|
|
||||||
<exec executable="bash" >
|
|
||||||
<arg value="-c" />
|
|
||||||
<arg value="cat ${archive.name} |ndk-stack -sym ../libs-debug/${abi}" />
|
|
||||||
</exec>
|
|
||||||
<fail message="Tests crashed" status="125"/>
|
|
||||||
</target>
|
|
||||||
</project>
|
|
172
liblinphone_tester/gradlew
vendored
Executable file
172
liblinphone_tester/gradlew
vendored
Executable file
|
@ -0,0 +1,172 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
NONSTOP* )
|
||||||
|
nonstop=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Escape application args
|
||||||
|
save ( ) {
|
||||||
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
|
}
|
||||||
|
APP_ARGS=$(save "$@")
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
|
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||||
|
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
84
liblinphone_tester/gradlew.bat
vendored
Normal file
84
liblinphone_tester/gradlew.bat
vendored
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
|
@ -1,3 +0,0 @@
|
||||||
include ../jni/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/externals/build/cunit/Android.mk
|
|
||||||
include $(linphone-root-dir)/submodules/linphone/build/android/liblinphone_tester.mk
|
|
|
@ -1,7 +0,0 @@
|
||||||
LOCAL_PATH:= $(call my-dir)
|
|
||||||
include ../jni/Application.mk
|
|
||||||
APP_PROJECT_PATH := $(LOCAL_PATH)/../
|
|
||||||
APP_BUILD_SCRIPT := $(LOCAL_PATH)/Android.mk
|
|
||||||
APP_OPTIM := debug
|
|
||||||
|
|
||||||
APP_MODULES += cunit liblinphone_tester
|
|
Binary file not shown.
3
liblinphone_tester/settings.gradle
Normal file
3
liblinphone_tester/settings.gradle
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
include ':libLinphoneAndroidSdk'
|
||||||
|
project(':libLinphoneAndroidSdk').projectDir = new File(rootProject.projectDir,'..')
|
||||||
|
project(':libLinphoneAndroidSdk').buildFileName = "libLinphoneAndroidSdk.gradle"
|
|
@ -23,7 +23,7 @@ public class MainActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
try {
|
try {
|
||||||
TestUnit.copyAssetsFromPackage(getApplicationContext());
|
TestUnit.copyAssetsFromPackage(getApplicationContext());
|
||||||
|
|
|
@ -58,8 +58,8 @@ public class SuitesActivity extends Activity {
|
||||||
layout.addView(button);
|
layout.addView(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
|
|
@ -11,13 +11,13 @@ import java.lang.Override;
|
||||||
public class TestRunner extends JUnitReportTestRunner {
|
public class TestRunner extends JUnitReportTestRunner {
|
||||||
String mSuite = null;
|
String mSuite = null;
|
||||||
String mTest = null;
|
String mTest = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle arguments) {
|
public void onCreate(Bundle arguments) {
|
||||||
mSuite = arguments.getString("suite");
|
mSuite = arguments.getString("suite");
|
||||||
mTest = arguments.getString("test");
|
mTest = arguments.getString("test");
|
||||||
Tester.keepAccounts(true);
|
Tester.keepAccounts(true);
|
||||||
|
|
||||||
super.onCreate(arguments);
|
super.onCreate(arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public class TestRunner extends JUnitReportTestRunner {
|
||||||
Tester.clearAccounts();
|
Tester.clearAccounts();
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TestSuite getAllTests () {
|
public TestSuite getAllTests () {
|
||||||
TestSuite suite = new TestSuite("Tests");
|
TestSuite suite = new TestSuite("Tests");
|
||||||
|
@ -34,7 +34,7 @@ public class TestRunner extends JUnitReportTestRunner {
|
||||||
addSuites(suite, mSuite, mTest);
|
addSuites(suite, mSuite, mTest);
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSuites(TestSuite suite, String suiteCheck, String testCheck) {
|
public static void addSuites(TestSuite suite, String suiteCheck, String testCheck) {
|
||||||
TesterList testerList = new TesterList();
|
TesterList testerList = new TesterList();
|
||||||
testerList.run(new String[]{"tester", "--list-suites"});
|
testerList.run(new String[]{"tester", "--list-suites"});
|
||||||
|
@ -45,7 +45,7 @@ public class TestRunner extends JUnitReportTestRunner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSuite(TestSuite suite, String suiteStr, String testCheck) {
|
public static void addSuite(TestSuite suite, String suiteStr, String testCheck) {
|
||||||
TesterList testerList = new TesterList();
|
TesterList testerList = new TesterList();
|
||||||
testerList.run(new String[]{"tester", "--list-tests", suiteStr});
|
testerList.run(new String[]{"tester", "--list-tests", suiteStr});
|
||||||
|
|
|
@ -18,12 +18,12 @@ public class Tester {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isArmv7()
|
public static boolean isArmv7()
|
||||||
{
|
{
|
||||||
return System.getProperty("os.arch").contains("armv7");
|
return System.getProperty("os.arch").contains("armv7");
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
List<String> cpuabis=Version.getCpuAbis();
|
List<String> cpuabis=Version.getCpuAbis();
|
||||||
String ffmpegAbi;
|
String ffmpegAbi;
|
||||||
|
@ -41,7 +41,7 @@ public class Tester {
|
||||||
System.loadLibrary("mediastreamer_voip-" + abi);
|
System.loadLibrary("mediastreamer_voip-" + abi);
|
||||||
System.loadLibrary("linphone-" + abi);
|
System.loadLibrary("linphone-" + abi);
|
||||||
System.loadLibrary("linphonetester-" + abi);
|
System.loadLibrary("linphonetester-" + abi);
|
||||||
|
|
||||||
Log.i("LinphoneCoreFactoryImpl","Loading done with " + abi);
|
Log.i("LinphoneCoreFactoryImpl","Loading done with " + abi);
|
||||||
libLoaded=true;
|
libLoaded=true;
|
||||||
break;
|
break;
|
||||||
|
@ -49,19 +49,19 @@ public class Tester {
|
||||||
if (firstException == null) firstException=e;
|
if (firstException == null) firstException=e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!libLoaded){
|
if (!libLoaded){
|
||||||
throw new RuntimeException(firstException);
|
throw new RuntimeException(firstException);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
Version.dumpCapabilities();
|
Version.dumpCapabilities();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public native int run(String args[]);
|
public native int run(String args[]);
|
||||||
public static native void keepAccounts(boolean keep);
|
public static native void keepAccounts(boolean keep);
|
||||||
public static native void clearAccounts();
|
public static native void clearAccounts();
|
||||||
|
|
||||||
public void printLog(final int level, final String message) {
|
public void printLog(final int level, final String message) {
|
||||||
switch(level) {
|
switch(level) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -9,7 +9,7 @@ public class TesterList extends Tester {
|
||||||
super.printLog(level, message);
|
super.printLog(level, message);
|
||||||
list.add(message);
|
list.add(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getList() {
|
public List<String> getList() {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class WrapperTester extends AndroidTestCase {
|
||||||
super();
|
super();
|
||||||
setName("wrapper tester");
|
setName("wrapper tester");
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneCore mCore;
|
LinphoneCore mCore;
|
||||||
@Override
|
@Override
|
||||||
protected void runTest() throws Throwable {
|
protected void runTest() throws Throwable {
|
||||||
|
@ -27,39 +27,39 @@ public class WrapperTester extends AndroidTestCase {
|
||||||
Assert.assertEquals(true, mCore.audioMulticastEnabled());
|
Assert.assertEquals(true, mCore.audioMulticastEnabled());
|
||||||
mCore.enableAudioMulticast(false);
|
mCore.enableAudioMulticast(false);
|
||||||
Assert.assertEquals(false, mCore.audioMulticastEnabled());
|
Assert.assertEquals(false, mCore.audioMulticastEnabled());
|
||||||
|
|
||||||
mCore.enableVideoMulticast(true);
|
mCore.enableVideoMulticast(true);
|
||||||
Assert.assertEquals(true, mCore.videoMulticastEnabled());
|
Assert.assertEquals(true, mCore.videoMulticastEnabled());
|
||||||
mCore.enableVideoMulticast(false);
|
mCore.enableVideoMulticast(false);
|
||||||
Assert.assertEquals(false, mCore.videoMulticastEnabled());
|
Assert.assertEquals(false, mCore.videoMulticastEnabled());
|
||||||
|
|
||||||
LinphoneCallParams params = mCore.createCallParams(null);
|
LinphoneCallParams params = mCore.createCallParams(null);
|
||||||
params.enableAudioMulticast(true);
|
params.enableAudioMulticast(true);
|
||||||
Assert.assertEquals(true, params.audioMulticastEnabled());
|
Assert.assertEquals(true, params.audioMulticastEnabled());
|
||||||
params.enableAudioMulticast(false);
|
params.enableAudioMulticast(false);
|
||||||
Assert.assertEquals(false, params.audioMulticastEnabled());
|
Assert.assertEquals(false, params.audioMulticastEnabled());
|
||||||
|
|
||||||
params.enableVideoMulticast(true);
|
params.enableVideoMulticast(true);
|
||||||
Assert.assertEquals(true, params.videoMulticastEnabled());
|
Assert.assertEquals(true, params.videoMulticastEnabled());
|
||||||
params.enableVideoMulticast(false);
|
params.enableVideoMulticast(false);
|
||||||
Assert.assertEquals(false, params.videoMulticastEnabled());
|
Assert.assertEquals(false, params.videoMulticastEnabled());
|
||||||
|
|
||||||
|
|
||||||
String ip = "224.3.2.1";
|
String ip = "224.3.2.1";
|
||||||
mCore.setAudioMulticastAddr(ip);
|
mCore.setAudioMulticastAddr(ip);
|
||||||
Assert.assertEquals(ip, mCore.getAudioMulticastAddr());
|
Assert.assertEquals(ip, mCore.getAudioMulticastAddr());
|
||||||
|
|
||||||
ip = "224.3.2.3";
|
ip = "224.3.2.3";
|
||||||
mCore.setVideoMulticastAddr(ip);
|
mCore.setVideoMulticastAddr(ip);
|
||||||
Assert.assertEquals(ip, mCore.getVideoMulticastAddr());
|
Assert.assertEquals(ip, mCore.getVideoMulticastAddr());
|
||||||
|
|
||||||
mCore.setAudioMulticastTtl(3);
|
mCore.setAudioMulticastTtl(3);
|
||||||
Assert.assertEquals(3, mCore.getAudioMulticastTtl());
|
Assert.assertEquals(3, mCore.getAudioMulticastTtl());
|
||||||
|
|
||||||
mCore.setVideoMulticastTtl(4);
|
mCore.setVideoMulticastTtl(4);
|
||||||
Assert.assertEquals(4, mCore.getVideoMulticastTtl());
|
Assert.assertEquals(4, mCore.getVideoMulticastTtl());
|
||||||
//multicast end
|
//multicast end
|
||||||
|
|
||||||
//Test setPrimaryContact
|
//Test setPrimaryContact
|
||||||
String address = "Linphone Android <sip:linphone.android@unknown-host>";
|
String address = "Linphone Android <sip:linphone.android@unknown-host>";
|
||||||
mCore.setPrimaryContact(address);
|
mCore.setPrimaryContact(address);
|
||||||
|
@ -87,7 +87,7 @@ public class WrapperTester extends AndroidTestCase {
|
||||||
LinphoneFriend friend = mCore.createFriendWithAddress("sip:lala@test.linphone.org");
|
LinphoneFriend friend = mCore.createFriendWithAddress("sip:lala@test.linphone.org");
|
||||||
friend.setRefKey(key);
|
friend.setRefKey(key);
|
||||||
Assert.assertEquals(friend.getRefKey(),key);
|
Assert.assertEquals(friend.getRefKey(),key);
|
||||||
|
|
||||||
//Test filter enablement
|
//Test filter enablement
|
||||||
Factory factory = mCore.getMSFactory();
|
Factory factory = mCore.getMSFactory();
|
||||||
factory.enableFilterFromName("MSUlawEnc", false);
|
factory.enableFilterFromName("MSUlawEnc", false);
|
||||||
|
|
366
library.patch
366
library.patch
|
@ -1,366 +0,0 @@
|
||||||
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
|
|
||||||
index 8bc78f3..5481307 100755
|
|
||||||
--- a/AndroidManifest.xml
|
|
||||||
+++ b/AndroidManifest.xml
|
|
||||||
@@ -8,314 +8,4 @@
|
|
||||||
<uses-sdk
|
|
||||||
android:minSdkVersion="14"
|
|
||||||
android:targetSdkVersion="23"/>
|
|
||||||
-
|
|
||||||
- <!-- Permissions for Push Notification -->
|
|
||||||
- <!--<uses-permission android:name="org.linphone.permission.C2D_MESSAGE"/> GCM permission--> <!-- Change package ! -->
|
|
||||||
- <!--<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> GCM permission-->
|
|
||||||
- <uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
- <uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
|
||||||
- <uses-permission android:name="android.permission.READ_CONTACTS"/>
|
|
||||||
- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
|
||||||
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
|
||||||
- <uses-permission android:name="android.permission.WAKE_LOCK"/>
|
|
||||||
- <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
|
|
||||||
- <uses-permission android:name="android.permission.CALL_PHONE"/>
|
|
||||||
- <!-- Needed to allow Linphone to install on tablets, since android.permission.CALL_PHONE implies android.hardware.telephony is required -->
|
|
||||||
- <uses-feature
|
|
||||||
- android:name="android.hardware.telephony"
|
|
||||||
- android:required="false"/>
|
|
||||||
-
|
|
||||||
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
|
||||||
- <uses-permission android:name="android.permission.VIBRATE"/>
|
|
||||||
- <uses-permission android:name="android.permission.CAMERA"/>
|
|
||||||
- <!-- Needed to allow Linphone to install on tablets, since android.permission.CAMERA implies android.hardware.camera and android.hardware.camera.autofocus are required -->
|
|
||||||
- <uses-feature
|
|
||||||
- android:name="android.hardware.camera"
|
|
||||||
- android:required="false"/>
|
|
||||||
-
|
|
||||||
- <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
|
||||||
- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
|
||||||
- <!-- Needed to store received images if the user wants to -->
|
|
||||||
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
||||||
- <!-- Needed to use our own Contact editor -->
|
|
||||||
- <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
|
|
||||||
- <!-- Needed to route the audio to the bluetooth headset if available -->
|
|
||||||
- <uses-permission android:name="android.permission.BLUETOOTH"/>
|
|
||||||
- <uses-permission android:name="android.permission.BROADCAST_STICKY"/>
|
|
||||||
- <!-- Needed to pre fill the wizard email field (only if enabled in custom settings) -->
|
|
||||||
- <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
|
|
||||||
- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
|
||||||
- <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
|
|
||||||
- <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
|
|
||||||
- <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
|
|
||||||
- <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
|
|
||||||
- <!-- Needed for in-app purchase -->
|
|
||||||
- <!-- <uses-permission android:name="com.android.vending.BILLING"/> -->
|
|
||||||
- <!-- Needed for overlay widget -->
|
|
||||||
- <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
||||||
-
|
|
||||||
- <supports-screens
|
|
||||||
- android:anyDensity="true"
|
|
||||||
- android:largeScreens="true"
|
|
||||||
- android:normalScreens="true"
|
|
||||||
- android:smallScreens="true"
|
|
||||||
- android:xlargeScreens="true"/>
|
|
||||||
-
|
|
||||||
- <application
|
|
||||||
- android:allowBackup="true"
|
|
||||||
- android:icon="@mipmap/ic_launcher"
|
|
||||||
- android:label="@string/app_name"
|
|
||||||
- android:largeHeap="true">
|
|
||||||
- <activity
|
|
||||||
- android:name=".LinphoneLauncherActivity"
|
|
||||||
- android:exported="true"
|
|
||||||
- android:label="@string/app_name"
|
|
||||||
- android:theme="@style/NoTitle"
|
|
||||||
- android:windowSoftInputMode="adjustPan|stateHidden">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
-
|
|
||||||
- <category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.CALL"/>
|
|
||||||
- <action android:name="android.intent.action.CALL_PRIVILEGED"/>
|
|
||||||
-
|
|
||||||
- <category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
-
|
|
||||||
- <data android:scheme="tel"/>
|
|
||||||
- <data android:scheme="sip"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.SENDTO"/>
|
|
||||||
-
|
|
||||||
- <category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
-
|
|
||||||
- <data android:scheme="sip"/>
|
|
||||||
- <data android:scheme="imto"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- <intent-filter>
|
|
||||||
- <data android:mimeType="@string/sync_mimetype"/> <!-- Change package in res/values/non_localizable_custom.xml ! -->
|
|
||||||
- <action android:name="android.intent.action.VIEW"/>
|
|
||||||
-
|
|
||||||
- <category android:name="android.intent.category.BROWSABLE"/>
|
|
||||||
- <category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".LinphoneActivity"
|
|
||||||
- android:launchMode="singleTask"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".CallIncomingActivity"
|
|
||||||
- android:launchMode="singleTop"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".CallOutgoingActivity"
|
|
||||||
- android:launchMode="singleTop"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".CallActivity"
|
|
||||||
- android:launchMode="singleTop"
|
|
||||||
- android:theme="@style/FullScreen">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
-
|
|
||||||
- <!--
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.VIEW" />
|
|
||||||
- <data android:mimeType="audio/*" />
|
|
||||||
- <data android:mimeType="video/*" />
|
|
||||||
- <category android:name="android.intent.category.DEFAULT" />
|
|
||||||
- </intent-filter>
|
|
||||||
- -->
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".assistant.AssistantActivity"
|
|
||||||
- android:screenOrientation="behind"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".purchase.InAppPurchaseActivity"
|
|
||||||
- android:screenOrientation="nosensor"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".assistant.RemoteProvisioningLoginActivity"
|
|
||||||
- android:screenOrientation="nosensor"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".assistant.RemoteProvisioningActivity"
|
|
||||||
- android:screenOrientation="nosensor"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- <intent-filter>
|
|
||||||
- <data android:scheme="linphone-config"/> <!-- Change if needed -->
|
|
||||||
- <action android:name="android.intent.action.VIEW"/>
|
|
||||||
-
|
|
||||||
- <category android:name="android.intent.category.BROWSABLE"/>
|
|
||||||
- <category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
-
|
|
||||||
- <service
|
|
||||||
- android:name=".LinphoneService"
|
|
||||||
- android:label="@string/service_name"
|
|
||||||
- android:stopWithTask="false"/>
|
|
||||||
- <service
|
|
||||||
- android:name=".sync.SyncService"
|
|
||||||
- android:exported="true">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.content.SyncAdapter"/>
|
|
||||||
- </intent-filter>
|
|
||||||
-
|
|
||||||
- <meta-data
|
|
||||||
- android:name="android.content.SyncAdapter"
|
|
||||||
- android:resource="@xml/syncadapter"/>
|
|
||||||
- <meta-data
|
|
||||||
- android:name="android.provider.CONTACTS_STRUCTURE"
|
|
||||||
- android:resource="@xml/contacts"/>
|
|
||||||
- </service>
|
|
||||||
- <service android:name=".sync.AuthenticationService">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.accounts.AccountAuthenticator"/>
|
|
||||||
- </intent-filter>
|
|
||||||
-
|
|
||||||
- <meta-data
|
|
||||||
- android:name="android.accounts.AccountAuthenticator"
|
|
||||||
- android:resource="@xml/authenticator"/>
|
|
||||||
- </service>
|
|
||||||
-
|
|
||||||
- <receiver android:name=".NetworkManager">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </receiver>
|
|
||||||
- <receiver
|
|
||||||
- android:name=".BluetoothManager"
|
|
||||||
- android:enabled="false">
|
|
||||||
- </receiver>
|
|
||||||
- <receiver android:name=".BootReceiver">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.BOOT_COMPLETED"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.ACTION_SHUTDOWN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </receiver>
|
|
||||||
- <receiver android:name=".PhoneStateChangedReceiver">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.PHONE_STATE"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </receiver>
|
|
||||||
-
|
|
||||||
- <!-- This one needs to be registered from application -->
|
|
||||||
- <receiver android:name=".KeepAliveReceiver"/>
|
|
||||||
-
|
|
||||||
- <!-- Needed for push notification -->
|
|
||||||
- <!--<receiver
|
|
||||||
- android:name=".gcm.GCMReceiver"
|
|
||||||
- android:permission="com.google.android.c2dm.permission.SEND">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
|
|
||||||
- <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
|
|
||||||
-
|
|
||||||
- <category android:name="org.linphone"/>--> <!-- Change package ! -->
|
|
||||||
- <!--</intent-filter>
|
|
||||||
- </receiver>
|
|
||||||
-
|
|
||||||
- <service android:name=".gcm.GCMService"/>-->
|
|
||||||
-
|
|
||||||
- <receiver
|
|
||||||
- android:name=".AccountEnableReceiver"
|
|
||||||
- android:permission="android.permission.CONFIGURE_SIP">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="org.linphone.intent.ACCOUNTACTIVATE"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </receiver>
|
|
||||||
-
|
|
||||||
- <service android:name=".firebase.FirebaseIdService">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </service>
|
|
||||||
-
|
|
||||||
- <service
|
|
||||||
- android:name=".firebase.FirebaseMessaging">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </service>
|
|
||||||
-
|
|
||||||
- <activity
|
|
||||||
- android:name=".tutorials.TutorialLauncherActivity"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".tutorials.TutorialBuddyStatusActivity"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".tutorials.TutorialChatRoomActivity"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".tutorials.TutorialHelloWorldActivity"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".tutorials.TutorialRegistrationActivity"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity
|
|
||||||
- android:name=".tutorials.TutorialCardDavSync"
|
|
||||||
- android:theme="@style/NoTitle">
|
|
||||||
- <intent-filter>
|
|
||||||
- <action android:name="android.intent.action.MAIN"/>
|
|
||||||
- </intent-filter>
|
|
||||||
- </activity>
|
|
||||||
- <activity android:name=".LinphoneGenericActivity">
|
|
||||||
- </activity>
|
|
||||||
- </application>
|
|
||||||
-
|
|
||||||
</manifest>
|
|
||||||
diff --git a/build.gradle b/build.gradle
|
|
||||||
index 3dd7bdc..9f467cb 100644
|
|
||||||
--- a/build.gradle
|
|
||||||
+++ b/build.gradle
|
|
||||||
@@ -25,7 +25,7 @@ buildscript {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-apply plugin: 'com.android.application'
|
|
||||||
+apply plugin: 'com.android.library'
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile fileTree(dir: 'libs', include: '*.jar')
|
|
||||||
@@ -44,7 +44,7 @@ android {
|
|
||||||
defaultConfig {
|
|
||||||
compileSdkVersion 23
|
|
||||||
buildToolsVersion "25.0.2"
|
|
||||||
- applicationId getPackageName()
|
|
||||||
+ //applicationId getPackageName()
|
|
||||||
multiDexEnabled true
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -57,17 +57,17 @@ android {
|
|
||||||
|
|
||||||
// Signing
|
|
||||||
signingConfigs {
|
|
||||||
- release {
|
|
||||||
- storeFile file(RELEASE_STORE_FILE)
|
|
||||||
- storePassword RELEASE_STORE_PASSWORD
|
|
||||||
- keyAlias RELEASE_KEY_ALIAS
|
|
||||||
- keyPassword RELEASE_KEY_PASSWORD
|
|
||||||
- }
|
|
||||||
+ //release {
|
|
||||||
+ //storeFile file(RELEASE_STORE_FILE)
|
|
||||||
+ //storePassword RELEASE_STORE_PASSWORD
|
|
||||||
+ //keyAlias RELEASE_KEY_ALIAS
|
|
||||||
+ //keyPassword RELEASE_KEY_PASSWORD
|
|
||||||
+ //}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
- signingConfig signingConfigs.release
|
|
||||||
+ signingConfig null//signingConfigs.release
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
126
linphoneAndroidSdk.gradle
Normal file
126
linphoneAndroidSdk.gradle
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
// Project information
|
||||||
|
buildDir = 'bin'
|
||||||
|
|
||||||
|
def getPackageName() {
|
||||||
|
return "org.linphone"
|
||||||
|
}
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:2.2.2'
|
||||||
|
classpath 'com.google.gms:google-services:3.0.0'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile fileTree(dir: 'libs', include: '*.jar')
|
||||||
|
compile 'com.google.firebase:firebase-messaging:9.0.0'
|
||||||
|
compile 'com.android.support:support-v4:+'
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
|
||||||
|
|
||||||
|
def srcDirs = ['submodules/linphone/mediastreamer2/java/src',
|
||||||
|
'submodules/linphone/java/j2se',
|
||||||
|
'submodules/linphone/java/common',
|
||||||
|
'submodules/linphone/java/impl',
|
||||||
|
'submodules/linphone/coreapi/help/java',
|
||||||
|
'src/org/',
|
||||||
|
'src/com']
|
||||||
|
|
||||||
|
def excludeFiles = []
|
||||||
|
|
||||||
|
excludeFiles.add('**/mediastream/MediastreamerActivity.java')
|
||||||
|
|
||||||
|
android {
|
||||||
|
defaultConfig {
|
||||||
|
compileSdkVersion 23
|
||||||
|
buildToolsVersion "25.0.2"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
lintOptions {
|
||||||
|
checkReleaseBuilds false
|
||||||
|
// Or, if you prefer, you can continue to check for errors in release builds,
|
||||||
|
// but continue the build even when errors are found:
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
|
java.srcDirs = srcDirs
|
||||||
|
resources.srcDirs = srcDirs
|
||||||
|
aidl.srcDirs = srcDirs
|
||||||
|
renderscript.srcDirs = srcDirs
|
||||||
|
res.srcDirs = ['res']
|
||||||
|
assets.srcDirs = ['assets']
|
||||||
|
jniLibs.srcDirs = ['libs']
|
||||||
|
|
||||||
|
java.excludes = excludeFiles
|
||||||
|
|
||||||
|
// Exclude some useless files
|
||||||
|
packagingOptions {
|
||||||
|
exclude '**/gdb.*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
debug.setRoot('build-types/debug')
|
||||||
|
release.setRoot('build-types/release')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
libraryVariants.all { variant ->
|
||||||
|
def appName = "linphone-android-sdk"
|
||||||
|
|
||||||
|
variant.outputs.each { output ->
|
||||||
|
def newSdkName = "bin/outputs/aar/${appName}.aar"
|
||||||
|
output.outputFile = new File(newSdkName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////// Task /////////////
|
||||||
|
|
||||||
|
task(releaseJavadoc, type: Javadoc, dependsOn: "assembleRelease") {
|
||||||
|
source = ['submodules/linphone/mediastreamer2/java/src',
|
||||||
|
'submodules/linphone/java/j2se',
|
||||||
|
'submodules/linphone/java/common',
|
||||||
|
'submodules/linphone/java/impl',
|
||||||
|
'submodules/linphone/coreapi/help/java']
|
||||||
|
excludes = ['**/mediastream/MediastreamerActivity.java',
|
||||||
|
'**/**.html',
|
||||||
|
'**/**.aidl']
|
||||||
|
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
||||||
|
classpath += files(android.libraryVariants.release.javaCompile.classpath.files)
|
||||||
|
}
|
||||||
|
|
||||||
|
task sourcesJar(type: Jar) {
|
||||||
|
classifier = 'sources'
|
||||||
|
from android.sourceSets.main.java.srcDirs
|
||||||
|
}
|
||||||
|
|
||||||
|
task androidJavadocsJar(type: Jar, dependsOn: releaseJavadoc) {
|
||||||
|
classifier = 'javadoc'
|
||||||
|
from releaseJavadoc.destinationDir
|
||||||
|
}
|
||||||
|
|
||||||
|
task sdkZip(type: Zip) {
|
||||||
|
String appName = "linphone-android-sdk"
|
||||||
|
String gitSha = 'git describe --always'.execute().text.trim()
|
||||||
|
String newSdkName = appName + "-" + gitSha + ".zip"
|
||||||
|
|
||||||
|
from('bin/libs',
|
||||||
|
'bin/outputs/aar')
|
||||||
|
include '*'
|
||||||
|
archiveName newSdkName
|
||||||
|
}
|
40
prepare.py
40
prepare.py
|
@ -205,11 +205,9 @@ class AndroidPreparator(prepare.Preparator):
|
||||||
archs={archs}
|
archs={archs}
|
||||||
TOPDIR=$(shell pwd)
|
TOPDIR=$(shell pwd)
|
||||||
LINPHONE_ANDROID_VERSION=$(shell git describe --always)
|
LINPHONE_ANDROID_VERSION=$(shell git describe --always)
|
||||||
ANT_SILENT=$(shell ant -h | grep -q -- -S && echo 1 || echo 0)
|
|
||||||
PACKAGE_NAME=$(shell sed -nE 's|<property name="linphone.package.name" value="(.*)" />|\\1|p' custom_rules.xml)
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
.NOTPARALLEL: all generate-apk generate-mediastreamer2-apk install release
|
.NOTPARALLEL: all generate-apk install release
|
||||||
|
|
||||||
all: generate-apk
|
all: generate-apk
|
||||||
|
|
||||||
|
@ -222,9 +220,6 @@ install: install-apk run-linphone
|
||||||
java-clean:
|
java-clean:
|
||||||
\t./gradlew clean
|
\t./gradlew clean
|
||||||
|
|
||||||
ant-clean:
|
|
||||||
\tant clean
|
|
||||||
|
|
||||||
$(TOPDIR)/res/raw/rootca.pem:
|
$(TOPDIR)/res/raw/rootca.pem:
|
||||||
\tcp liblinphone-sdk/android-{first_arch}/share/linphone/rootca.pem $@
|
\tcp liblinphone-sdk/android-{first_arch}/share/linphone/rootca.pem $@
|
||||||
|
|
||||||
|
@ -306,46 +301,43 @@ copy-libs:
|
||||||
\t\tcp -f liblinphone-sdk/android-x86/bin/gdb.setup libs/x86; \\
|
\t\tcp -f liblinphone-sdk/android-x86/bin/gdb.setup libs/x86; \\
|
||||||
\tfi
|
\tfi
|
||||||
|
|
||||||
update-mediastreamer2-project:
|
|
||||||
\t@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java
|
|
||||||
|
|
||||||
generate-apk: java-clean build copy-libs $(TOPDIR)/res/raw/rootca.pem
|
generate-apk: java-clean build copy-libs $(TOPDIR)/res/raw/rootca.pem
|
||||||
\techo "version.name=$(LINPHONE_ANDROID_VERSION)" > default.properties && \\
|
|
||||||
\t./gradlew assembleDebug
|
\t./gradlew assembleDebug
|
||||||
|
|
||||||
generate-mediastreamer2-apk: ant-clean build copy-libs update-mediastreamer2-project
|
|
||||||
\t@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \\
|
|
||||||
\techo "version.name=$(LINPHONE_ANDROID_VERSION)" > default.properties && \\
|
|
||||||
\tant debug
|
|
||||||
|
|
||||||
quick: clean install-apk run-linphone
|
quick: clean install-apk run-linphone
|
||||||
|
|
||||||
install-apk:
|
install-apk:
|
||||||
\t./gradlew installDebug
|
\t./gradlew installDebug
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
\tadb uninstall $(PACKAGE_NAME)
|
\t./gradlew uninstallAll
|
||||||
|
|
||||||
release: java-clean build copy-libs
|
release: java-clean build copy-libs
|
||||||
\t./gradlew assembleRelease
|
\t./gradlew assembleRelease
|
||||||
|
|
||||||
generate-sdk: liblinphone-android-sdk
|
generate-sdk: liblinphone-android-sdk
|
||||||
|
|
||||||
liblinphone-android-sdk: generate-apk
|
liblinphone-android-sdk: java-clean build copy-libs $(TOPDIR)/res/raw/rootca.pem
|
||||||
\ttant liblinphone-android-sdk
|
\t./gradlew -b libLinphoneAndroidSdk.gradle androidJavadocsJar
|
||||||
|
\t./gradlew -b libLinphoneAndroidSdk.gradle sourcesJar
|
||||||
|
\t./gradlew -b libLinphoneAndroidSdk.gradle assembleRelease
|
||||||
|
\t./gradlew -b libLinphoneAndroidSdk.gradle sdkZip
|
||||||
|
|
||||||
linphone-android-sdk: generate-apk
|
linphone-android-sdk: java-clean build copy-libs $(TOPDIR)/res/raw/rootca.pem
|
||||||
\tant linphone-android-sdk
|
\t./gradlew -b linphoneAndroidSdk.gradle androidJavadocsJar
|
||||||
|
\t./gradlew -b linphoneAndroidSdk.gradle sourcesJar
|
||||||
|
\t./gradlew -b linphoneAndroidSdk.gradle assembleRelease
|
||||||
|
\t./gradlew -b linphoneAndroidSdk.gradle sdkZip
|
||||||
|
|
||||||
mediastreamer2-sdk: generate-mediastreamer2-apk
|
mediastreamer2-sdk: build copy-libs
|
||||||
\t@cd $(TOPDIR)/submodules/linphone/mediastreamer2/java && \\
|
\t@cd $(TOPDIR)/submodules/mediastreamer2/java && \\
|
||||||
\tant mediastreamer2-sdk
|
\t./gradlew assembleRelease
|
||||||
|
|
||||||
liblinphone_tester:
|
liblinphone_tester:
|
||||||
\t$(MAKE) -C liblinphone_tester
|
\t$(MAKE) -C liblinphone_tester
|
||||||
|
|
||||||
run-linphone:
|
run-linphone:
|
||||||
\tadb shell monkey -p $(PACKAGE_NAME) -c android.intent.category.LAUNCHER 1
|
\t./gradlew runApplication
|
||||||
|
|
||||||
run-liblinphone-tests:
|
run-liblinphone-tests:
|
||||||
\t@cd liblinphone_tester && \\
|
\t@cd liblinphone_tester && \\
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2781e5a5d3c150fa277765bea00ea60e61dd76c4
|
Subproject commit 21a3e023adef4fe2568340af28cd3487e268ba2e
|
Loading…
Reference in a new issue