133 lines
3.5 KiB
Groovy
133 lines
3.5 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
def getPackageName() {
|
|
return "org.linphone"
|
|
}
|
|
|
|
def firebaseEnabled() {
|
|
File googleFile = new File('app/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()
|
|
}
|
|
|
|
///// 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 {
|
|
// Switch to release for releases !
|
|
url "https://gitlab.linphone.org/BC/public/maven_repository/raw/master"
|
|
}
|
|
}
|
|
|
|
android {
|
|
lintOptions {
|
|
abortOnError false
|
|
}
|
|
|
|
compileSdkVersion 28
|
|
defaultConfig {
|
|
minSdkVersion 21
|
|
targetSdkVersion 28
|
|
versionCode 4107
|
|
versionName "4.1"
|
|
applicationId getPackageName()
|
|
multiDexEnabled true
|
|
}
|
|
|
|
applicationVariants.all { variant ->
|
|
variant.outputs.all {
|
|
outputFileName = "linphone-android-${variant.buildType.name}-${defaultConfig.versionName}.apk"
|
|
}
|
|
}
|
|
|
|
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
def keystoreProperties = new Properties()
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
|
|
signingConfigs {
|
|
release {
|
|
storeFile file(keystoreProperties['storeFile'])
|
|
storePassword keystoreProperties['storePassword']
|
|
keyAlias keystoreProperties['keyAlias']
|
|
keyPassword keystoreProperties['keyPassword']
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled true
|
|
signingConfig signingConfigs.release
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
debug {
|
|
applicationIdSuffix ".debug"
|
|
debuggable true
|
|
jniDebuggable true
|
|
versionNameSuffix '-debug'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
packagingOptions {
|
|
excludes = excludePackage
|
|
}
|
|
}
|
|
}
|
|
|
|
packagingOptions {
|
|
pickFirst 'META-INF/NOTICE'
|
|
pickFirst 'META-INF/LICENSE'
|
|
exclude 'META-INF/MANIFEST.MF'
|
|
}
|
|
}
|
|
|
|
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'
|
|
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'
|
|
implementation 'com.google.android:flexbox:1.1.0'
|
|
|
|
if (isLocalAarAvailable()) {
|
|
implementation project(":linphone-sdk-android")
|
|
} else {
|
|
implementation "org.linphone:linphone-sdk-android:4.1+"
|
|
}
|
|
}
|
|
if (firebaseEnabled()) {
|
|
apply plugin: 'com.google.gms.google-services'
|
|
}
|
|
|
|
apply plugin: "com.diffplug.gradle.spotless"
|
|
spotless {
|
|
java {
|
|
target '**/*.java'
|
|
googleJavaFormat('1.6').aosp()
|
|
removeUnusedImports()
|
|
}
|
|
}
|
|
project.tasks['preBuild'].dependsOn 'spotlessApply'
|