linphone-android/app/build.gradle
Sylvain Berfini 4b846bcca8 Started to split LinphoneActivity in multiple activities
Added new activities that will replace LinphoneActivity

Added About & Dialer activities

Fixed back key press

Transformed Recordings fragment into activity

Started Settings activity

Small improvement for Recordings

Finished dialer

Permission shenanigans

Added back History

Small history improvements

Fixed issue with rotation in History

Started contacts

More changes & fixes for Chat

Improved performances when switching between activities

Prevent keyboard from opening automatically on some views

Added back workaround for infinite loop if screen off

Fixes & improvements

Some cleanup but a lot of work still left

Switching back to classic fragment fixed issues

Lots of fixes & improvements over History & Contacts

More work on chat

Small refactoring of license header

Settings & Chat fixes/improvements

More TODO FIXES removal

Tablet fixes

Fixes & improvements

Fixed back button on tablets

Got rid of LinphoneActivity

Fixed TODO FIXME related to permissions

Started chat room group info

Lot of fixes & improvements over Chat

Fixed sharing feature if LinphoneService isn't running

Lifecycle improvements

Sharing from outside app finished

Fixed quit button

Fixed display of missed chat/calls

Clean old code for chat rooms unread message count

Improved unread message count on tablets

This isn't useful anymore

Fixed last issue with unread count not updating in chat rooms list using new callbacks

Fixed latest TODO FIXME due to CallAcitvity singleton removal

Updated remaining TODOs

Fixed issue with outgoing call not going to call activity once answered

Fixed back key press go home feature

Removed dead code

Code cleanup thanks to Android Studio inspector

Added back device power saver dialog + update registration state changed in menu

More auto rework by Android Studio + added back checkForUpdate & isAccountWithAlias method calls

More improvements, most of them on layout files

Fixed secured group chat rooms creation

Improved launch screen by using logo on gray background instead of default white screen

Added workaround for faster display of splashscreen

Removed noHistory flag on Settings, will be weird when going back from Android native settings

Fixed display of call logs list in history details in landscape on smartphone depending on screen size

Reorganized activities + fixed dark theme switch

Manager & Service cleanup

Simplified notification process

More manager simplifications

Moved audio manager related code from LinphoneManager to dedicated class

Core accessor cleanup

Exclude XmlRpc & InApp related code from standard APK + moved call related methods from LinphoneManager to CallManager

Fixed click on chat bottom bar button doing nothing after going into chatroom through notification or shortcut

Fixed chat message fragment update if presence is received while view has already been displayed

Improved second to last commit

Fixed navigation issue in chat

More code improvements
2019-05-03 13:54:45 +02:00

200 lines
6 KiB
Groovy

apply plugin: 'com.android.application'
static def getPackageName() {
return "org.linphone"
}
static def firebaseEnabled() {
File googleFile = new File('app/google-services.json')
return googleFile.exists()
}
static def isLocalDebugAarAvailable() {
File debugAar = new File('linphone-sdk-android/linphone-sdk-android-debug.aar')
return debugAar.exists()
}
static def isLocalReleaseAarAvailable() {
File releaseAar = new File('linphone-sdk-android/linphone-sdk-android-release.aar')
return releaseAar.exists()
}
static def isLocalAarAvailable() {
return isLocalDebugAarAvailable() || isLocalReleaseAarAvailable()
}
///// Exclude Files /////
def excludeFiles = []
if (!firebaseEnabled()) {
excludeFiles.add('**/Firebase*')
println '[Push Notification] Firebase disabled'
}
// Remove or comment if you want to use those
excludeFiles.add('**/XmlRpc*')
excludeFiles.add('**/InAppPurchase*')
def excludePackage = []
excludePackage.add('**/gdb.*')
excludePackage.add('**/libopenh264**')
excludePackage.add('**/**tester**')
excludePackage.add('**/LICENSE.txt')
def gitVersion = new ByteArrayOutputStream()
task getGitVersion {
exec {
commandLine 'git', 'describe', '--always'
standardOutput = gitVersion
}
doLast {
gitVersion = gitVersion.toString().trim()
println("Git version: " + gitVersion)
}
}
project.tasks['preBuild'].dependsOn 'getGitVersion'
/////////////////////////
repositories {
maven {
// Replace snapshots by releases for releases !
url "https://linphone.org/snapshots/maven_repository"
}
}
android {
lintOptions {
abortOnError false
}
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 4124
versionName "4.1"
applicationId getPackageName()
multiDexEnabled true
manifestPlaceholders = [linphone_address_mime_type:"vnd.android.cursor.item/vnd." + getPackageName() + ".provider.sip_address"]
}
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "linphone-android-${variant.buildType.name}-${gitVersion.toString().trim()}.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'
resValue "string", "sync_account_type", getPackageName() + ".sync"
resValue "string", "file_provider", getPackageName() + ".provider"
resValue "string", "linphone_address_mime_type", "vnd.android.cursor.item/vnd." + getPackageName() + ".provider.sip_address"
if (!firebaseEnabled()) {
resValue "string", "gcm_defaultSenderId", "none"
}
}
debug {
applicationIdSuffix ".debug"
debuggable true
jniDebuggable true
versionNameSuffix '-debug'
resValue "string", "sync_account_type", getPackageName() + ".sync"
resValue "string", "file_provider", getPackageName() + ".provider"
resValue "string", "linphone_address_mime_type", "vnd.android.cursor.item/vnd." + getPackageName() + ".provider.sip_address"
if (!firebaseEnabled()) {
resValue "string", "gcm_defaultSenderId", "none"
}
}
}
sourceSets {
main {
java.excludes = excludeFiles
packagingOptions {
excludes = excludePackage
}
}
}
packagingOptions {
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/LICENSE'
exclude 'META-INF/MANIFEST.MF'
}
}
dependencies {
if (firebaseEnabled()) {
implementation 'com.google.firebase:firebase-messaging:17.5.0'
}
implementation 'com.android.billingclient:billing:1.2'
implementation 'org.apache.commons:commons-compress:1.18'
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-alpha04'
implementation 'com.google.android:flexbox:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
if (isLocalAarAvailable()) {
if (isLocalReleaseAarAvailable()) {
//debug AAR is a lot bigger than release one, and APK install time will be much longer so use release one for day-to-day development
implementation project(path: ":linphone-sdk-android", configuration: 'release')
} else {
releaseImplementation project(path: ":linphone-sdk-android", configuration: 'release')
debugImplementation project(path: ":linphone-sdk-android", configuration: 'debug')
}
} else {
implementation "org.linphone:linphone-sdk-android:4.2"
}
}
if (firebaseEnabled()) {
apply plugin: 'com.google.gms.google-services'
}
task generateContactsXml(type: Copy) {
from 'contacts.xml'
into "src/main/res/xml/"
filter {
line -> line
.replaceAll('%%AUTO_GENERATED%%', 'This file has been automatically generated, do not edit or commit !')
.replaceAll('%%PACKAGE_NAME%%', getPackageName())
}
}
project.tasks['preBuild'].dependsOn 'generateContactsXml'
apply plugin: "com.diffplug.gradle.spotless"
spotless {
java {
target '**/*.java'
googleJavaFormat('1.6').aosp()
removeUnusedImports()
}
}
project.tasks['preBuild'].dependsOn 'spotlessApply'