difuse-phone-android/app/build.gradle

199 lines
6.1 KiB
Groovy
Raw Normal View History

2018-11-15 12:06:12 +00:00
apply plugin: 'com.android.application'
static def getPackageName() {
2018-11-15 12:06:12 +00:00
return "org.linphone"
}
static def firebaseEnabled() {
2018-11-24 08:46:31 +00:00
File googleFile = new File('app/google-services.json')
2018-11-15 12:06:12 +00:00
return googleFile.exists()
}
2019-05-16 10:18:57 +00:00
task getGitVersion() {
2020-06-24 08:09:12 +00:00
def gitVersion = "4.4.0"
2019-05-16 10:18:57 +00:00
def gitVersionStream = new ByteArrayOutputStream()
def gitCommitsCount = new ByteArrayOutputStream()
def gitCommitHash = new ByteArrayOutputStream()
2019-05-16 10:18:57 +00:00
2019-05-17 11:53:04 +00:00
try {
exec {
executable "git" args "describe", "--abbrev=0"
2019-05-17 11:53:04 +00:00
standardOutput = gitVersionStream
}
exec {
executable "git" args "rev-list", gitVersionStream.toString().trim() + "..HEAD", "--count"
standardOutput = gitCommitsCount
}
exec {
executable "git" args "rev-parse", "--short", "HEAD"
standardOutput = gitCommitHash
}
if (gitCommitsCount.toString().toInteger() == 0) {
gitVersion = gitVersionStream.toString().trim()
} else {
gitVersion = gitVersionStream.toString().trim() + "." + gitCommitsCount.toString().trim() + "+" + gitCommitHash.toString().trim()
}
2019-05-16 10:18:57 +00:00
println("Git version: " + gitVersion)
2019-05-17 11:53:04 +00:00
} catch (Exception e) {
2019-05-16 10:18:57 +00:00
println("Git not found")
}
project.version = gitVersion
}
2018-11-15 12:06:12 +00:00
///// Exclude Files /////
def excludeFiles = []
if (!firebaseEnabled()) {
excludeFiles.add('**/Firebase*')
println '[Push Notification] Firebase disabled'
}
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-04-24 09:18:47 +00:00
// Remove or comment if you want to use those
excludeFiles.add('**/XmlRpc*')
excludeFiles.add('**/InAppPurchase*')
2018-11-15 12:06:12 +00:00
def excludePackage = []
excludePackage.add('**/gdb.*')
excludePackage.add('**/libopenh264**')
excludePackage.add('**/**tester**')
excludePackage.add('**/LICENSE.txt')
/////////////////////////
repositories {
maven {
url file(LinphoneSdkBuildDir + '/maven_repository/')
}
2018-11-16 09:33:03 +00:00
maven {
2019-11-13 11:52:56 +00:00
url "https://linphone.org/maven_repository"
2018-11-15 12:06:12 +00:00
}
}
2019-05-16 10:18:57 +00:00
project.tasks['preBuild'].dependsOn 'getGitVersion'
2018-11-15 12:06:12 +00:00
android {
lintOptions {
abortOnError false
}
compileSdkVersion 29
2018-11-15 12:06:12 +00:00
defaultConfig {
2020-06-24 08:09:12 +00:00
minSdkVersion 23
targetSdkVersion 29
2020-06-15 07:36:15 +00:00
versionCode 4300
2019-05-16 10:18:57 +00:00
versionName "${project.version}"
2018-11-15 12:06:12 +00:00
applicationId getPackageName()
multiDexEnabled true
}
2018-11-19 10:59:12 +00:00
applicationVariants.all { variant ->
variant.outputs.all {
2019-05-16 10:18:57 +00:00
outputFileName = "linphone-android-${variant.buildType.name}-${project.version}.apk"
2018-11-19 10:59:12 +00:00
}
if (variant.buildType.name == "release") {
variant.getMergedFlavor().manifestPlaceholders = [linphone_address_mime_type: "vnd.android.cursor.item/vnd." + getPackageName() + ".provider.sip_address",
linphone_file_provider: getPackageName() + ".provider"]
} else {
variant.getMergedFlavor().manifestPlaceholders = [linphone_address_mime_type: "vnd.android.cursor.item/vnd." + getPackageName() + ".provider.sip_address",
linphone_file_provider: getPackageName() + ".debug.provider"]
}
2018-11-19 10:59:12 +00:00
}
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-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'
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"
}
2018-11-15 12:06:12 +00:00
}
debug {
applicationIdSuffix ".debug"
debuggable true
jniDebuggable true
resValue "string", "sync_account_type", getPackageName() + ".sync"
resValue "string", "file_provider", getPackageName() + ".debug.provider"
resValue "string", "linphone_address_mime_type", "vnd.android.cursor.item/vnd." + getPackageName() + ".provider.sip_address"
if (!firebaseEnabled()) {
resValue "string", "gcm_defaultSenderId", "none"
}
2018-11-15 12:06:12 +00:00
}
}
sourceSets {
main {
java.excludes = excludeFiles
2018-11-15 12:06:12 +00:00
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'
}
}
dependencies {
compileOnly 'org.jetbrains:annotations:19.0.0'
if (firebaseEnabled()) {
implementation 'com.google.firebase:firebase-messaging:19.0.1'
}
2018-11-23 15:30:14 +00:00
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android:flexbox:1.1.0'
2019-02-21 09:24:19 +00:00
implementation 'com.github.bumptech.glide:glide:4.9.0'
2020-06-24 08:09:12 +00:00
implementation "org.linphone:linphone-sdk-android:4.5+"
2018-11-24 08:46:31 +00:00
}
if (firebaseEnabled()) {
apply plugin: 'com.google.gms.google-services'
2018-11-26 10:18:15 +00:00
}
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'
2018-11-26 10:18:15 +00:00
apply plugin: "com.diffplug.gradle.spotless"
spotless {
java {
target '**/*.java'
googleJavaFormat('1.6').aosp()
removeUnusedImports()
}
}
project.tasks['preBuild'].dependsOn 'spotlessApply'