2018-11-15 12:06:12 +00:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
def getPackageName() {
|
|
|
|
return "org.linphone"
|
|
|
|
}
|
|
|
|
|
|
|
|
def firebaseEnabled() {
|
|
|
|
File googleFile = new File('google-services.json')
|
|
|
|
return googleFile.exists()
|
|
|
|
}
|
|
|
|
|
|
|
|
def isLocalAarAvailable() {
|
2018-11-15 12:53:23 +00:00
|
|
|
File debugAar = new File('linphone-sdk-android/linphone-sdk-android-debug.aar')
|
|
|
|
File releaseAar = new File('linphone-sdk-android/linphone-sdk-android-release.aar')
|
2018-11-15 12:06:12 +00:00
|
|
|
return debugAar.exists() || releaseAar.exists()
|
|
|
|
}
|
|
|
|
|
|
|
|
if (firebaseEnabled()) {
|
|
|
|
apply plugin: 'com.google.gms.google-services'
|
|
|
|
}
|
|
|
|
|
|
|
|
///// Exclude Files /////
|
|
|
|
|
|
|
|
def excludeFiles = []
|
|
|
|
if (!firebaseEnabled()) {
|
|
|
|
excludeFiles.add('**/Firebase*')
|
|
|
|
println '[Push Notification] Firebase disabled'
|
|
|
|
}
|
|
|
|
|
|
|
|
def excludePackage = []
|
|
|
|
|
|
|
|
excludePackage.add('**/gdb.*')
|
|
|
|
excludePackage.add('**/libopenh264**')
|
|
|
|
excludePackage.add('**/**tester**')
|
|
|
|
excludePackage.add('**/LICENSE.txt')
|
|
|
|
|
|
|
|
/////////////////////////
|
|
|
|
|
|
|
|
repositories {
|
2018-11-16 09:33:03 +00:00
|
|
|
maven {
|
|
|
|
url "https://gitlab.linphone.org/BC/public/maven_repository/raw/master"
|
2018-11-15 12:06:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2018-11-19 09:14:43 +00:00
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
}
|
|
|
|
|
2018-11-15 12:06:12 +00:00
|
|
|
compileSdkVersion 28
|
|
|
|
defaultConfig {
|
2018-11-19 09:14:43 +00:00
|
|
|
minSdkVersion 21
|
2018-11-15 12:06:12 +00:00
|
|
|
targetSdkVersion 28
|
2018-11-23 14:34:35 +00:00
|
|
|
versionCode 4103
|
2018-11-15 12:06:12 +00:00
|
|
|
versionName "4.1"
|
|
|
|
applicationId getPackageName()
|
|
|
|
multiDexEnabled true
|
|
|
|
}
|
2018-11-19 09:14:43 +00:00
|
|
|
|
2018-11-19 10:59:12 +00:00
|
|
|
applicationVariants.all { variant ->
|
|
|
|
variant.outputs.all {
|
|
|
|
outputFileName = "linphone-android-${variant.buildType.name}-${defaultConfig.versionName}.apk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-19 09:42:14 +00:00
|
|
|
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
|
|
def keystoreProperties = new Properties()
|
|
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
|
|
|
2018-11-15 12:06:12 +00:00
|
|
|
signingConfigs {
|
|
|
|
release {
|
2018-11-19 09:42:14 +00:00
|
|
|
storeFile file(keystoreProperties['storeFile'])
|
|
|
|
storePassword keystoreProperties['storePassword']
|
|
|
|
keyAlias keystoreProperties['keyAlias']
|
|
|
|
keyPassword keystoreProperties['keyPassword']
|
2018-11-15 12:06:12 +00:00
|
|
|
}
|
|
|
|
}
|
2018-11-19 09:14:43 +00:00
|
|
|
|
2018-11-15 12:06:12 +00:00
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled true
|
|
|
|
signingConfig signingConfigs.release
|
2018-11-19 09:27:25 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
2018-11-15 12:06:12 +00:00
|
|
|
}
|
|
|
|
debug {
|
|
|
|
applicationIdSuffix ".debug"
|
|
|
|
debuggable true
|
|
|
|
jniDebuggable true
|
2018-11-21 11:49:40 +00:00
|
|
|
versionNameSuffix '-debug'
|
2018-11-15 12:06:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
packagingOptions {
|
|
|
|
excludes = excludePackage
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-19 10:59:12 +00:00
|
|
|
|
2018-11-15 12:06:12 +00:00
|
|
|
packagingOptions {
|
|
|
|
pickFirst 'META-INF/NOTICE'
|
|
|
|
pickFirst 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/MANIFEST.MF'
|
|
|
|
}
|
2018-11-15 13:36:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation 'com.google.firebase:firebase-messaging:15.0.2'
|
|
|
|
implementation 'com.android.billingclient:billing:1.2'
|
|
|
|
implementation 'org.apache.commons:commons-compress:1.16.1'
|
2018-11-23 15:30:14 +00:00
|
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
|
|
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
|
|
|
implementation 'androidx.appcompat:appcompat:1.0.2'
|
|
|
|
implementation 'com.google.android.material:material:1.1.0-alpha01'
|
2018-11-15 13:36:05 +00:00
|
|
|
if (isLocalAarAvailable()) {
|
|
|
|
implementation project(":linphone-sdk-android")
|
|
|
|
} else {
|
2018-11-16 09:57:01 +00:00
|
|
|
// TODO: Use hardcoded correct SDK version number
|
2018-11-15 13:36:05 +00:00
|
|
|
releaseImplementation "org.linphone:liblinphone-sdk:${android.defaultConfig.versionName}"
|
|
|
|
debugImplementation "org.linphone:liblinphone-sdk:${android.defaultConfig.versionName}-DEBUG"
|
|
|
|
}
|
2018-11-15 12:06:12 +00:00
|
|
|
}
|