apply plugin: 'com.android.application' def getPackageName() { return "org.linphone" } def firebaseEnabled() { File googleFile = new File('google-services.json') return googleFile.exists() } def isLocalAarAvailable() { File debugAar = new File('linphone-sdk-android/linphone-sdk-android-debug.aar') File releaseAar = new File('linphone-sdk-android/linphone-sdk-android-release.aar') 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 { maven { url "https://gitlab.linphone.org/BC/public/maven_repository/raw/master" } } android { lintOptions { abortOnError false } compileSdkVersion 28 defaultConfig { minSdkVersion 21 targetSdkVersion 28 versionCode 4100 versionName "4.1" applicationId getPackageName() multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } signingConfigs { release { storeFile file(RELEASE_STORE_FILE) storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD } } buildTypes { release { minifyEnabled true signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { applicationIdSuffix ".debug" debuggable true jniDebuggable true } } sourceSets { main { packagingOptions { excludes = excludePackage } } } packagingOptions { pickFirst 'META-INF/NOTICE' pickFirst 'META-INF/LICENSE' exclude 'META-INF/MANIFEST.MF' } } dependencies { androidTestImplementation('com.android.support.test.espresso:espresso-core:+') { exclude module: 'support-annotations' } androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.3' androidTestImplementation 'junit:junit:4.12' 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' implementation 'com.android.support:support-v4:28.0.0' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:design:28.0.0' if (isLocalAarAvailable()) { implementation project(":linphone-sdk-android") } else { // TODO: Use hardcoded correct SDK version number releaseImplementation "org.linphone:liblinphone-sdk:${android.defaultConfig.versionName}" debugImplementation "org.linphone:liblinphone-sdk:${android.defaultConfig.versionName}-DEBUG" } }