Fix gradle build for Firebase and GCM push
This commit is contained in:
parent
9e81c62df0
commit
8b8c67873b
4 changed files with 37 additions and 15 deletions
|
@ -6,7 +6,7 @@ Linphone is a free VoIP and video softphone based on the SIP protocol.
|
|||
|
||||
1. Download the Android sdk (API 23 at least) with platform-tools and tools updated to latest revision, then add both 'tools' and 'platform-tools' folders in your path.
|
||||
|
||||
2. Download the Android ndk (version r11c or 12b) from google and add it to your path (no symlink !!!).
|
||||
2. Download the Android ndk (version r11c or 13b) from google and add it to your path (no symlink !!!).
|
||||
|
||||
3. Install _yasm_, _nasm_, _ant_, _python_, _intltoolize_, _cmake_ and _vim-common_.
|
||||
* On 64 bits linux systems you'll need the _ia32-libs_ package.
|
||||
|
@ -56,6 +56,12 @@ Simply run `make liblinphone_tester`. This will be build everything, generate an
|
|||
|
||||
You can speed up the compilation by using ccache (compiler cache, see [ccache.samba.org](https://ccache.samba.org/)). Give the *"-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"* options to the *prepare.py* script.
|
||||
|
||||
# PUSH NOTIFICATION
|
||||
|
||||
## Firebase
|
||||
|
||||
To enable firebase in Linphone, just add your 'google-service.json' in project root and you key in 'res/values/non_localizable_custom.xml'
|
||||
|
||||
# TROUBLESHOOTING
|
||||
|
||||
If you encounter the following issue:
|
||||
|
|
20
build.gradle
20
build.gradle
|
@ -1,8 +1,10 @@
|
|||
// Project information
|
||||
buildDir = 'bin'
|
||||
ext.linphonePackageName = "org.linphone"
|
||||
File googleFile2 = new File('google-services.json')
|
||||
|
||||
buildscript {
|
||||
File googleFile = new File('google-services.json')
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
|
@ -10,15 +12,26 @@ buildscript {
|
|||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.2.0'
|
||||
if (googleFile.exists()) {
|
||||
classpath 'com.google.gms:google-services:3.0.0'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
if (googleFile2.exists()) {
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
File googleFile = new File('google-services.json')
|
||||
compile fileTree(dir: 'libs', include: '*.jar')
|
||||
if (googleFile.exists()) {
|
||||
compile 'com.google.firebase:firebase-messaging:9.0.0'
|
||||
} else {
|
||||
compile 'com.android.support:support-v4:+'
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
|
@ -54,6 +67,11 @@ android {
|
|||
|
||||
sourceSets {
|
||||
main {
|
||||
File googleFile = new File('google-services.json')
|
||||
String firebase = ''
|
||||
if (!googleFile.exists()) {
|
||||
firebase = '**/Firebase*'
|
||||
}
|
||||
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']
|
||||
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']
|
||||
|
@ -64,6 +82,8 @@ android {
|
|||
jniLibs.srcDir 'libs'
|
||||
|
||||
java.exclude '**/mediastream/MediastreamerActivity.java'
|
||||
java.exclude firebase
|
||||
println firebase
|
||||
}
|
||||
|
||||
// Move the tests to tests/java, tests/res, etc...
|
||||
|
|
|
@ -96,8 +96,6 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.firebase.iid.FirebaseInstanceId;
|
||||
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
|
|
|
@ -108,8 +108,6 @@ import android.view.View;
|
|||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.firebase.iid.FirebaseInstanceId;
|
||||
|
||||
/**
|
||||
*
|
||||
* Manager of the low level LibLinphone stuff.<br />
|
||||
|
|
Loading…
Reference in a new issue