nextcloud-talk-android/app/build.gradle
Tim Krüger bad5b5f9bc
Update WebRTC library
The  updated libwebrtc will be load from the talk-clients-webrtc repository [1]
and not from a dependency repository. The 'lint' task must now depend on the
'perBuild' task to make sure that the WebRTC library is downloaded from the
configured URL.

To get the new version to work a change is needed because of this announcement:

> Google is planning to transition Chrome’s WebRTC implementation from the
> current SDP format (called “Plan B”) to a standards conformant format
> (“Unified Plan”, draft-ietf-rtcweb-jsep) over the next couple of quarters.
>
> - [2]

Currently we are in phase 4 of the transition [3]. So actually 'Plan B'
must be used to avoid bigger changes to our code base at this time. But
'Plan B' is depracted and will be removed in phase 5 of the transition
[4].

Resolves: #1773
See:
  - [1] https://github.com/nextcloud-releases/talk-clients-webrtc
  - [2] https://webrtc.org/getting-started/unified-plan-transition-guide
  - [3] https://webrtc.org/getting-started/unified-plan-transition-guide#phase_4_make_%E2%80%9Cplan_b%E2%80%9D_throw
  - [4] https://webrtc.org/getting-started/unified-plan-transition-guide#phase_5_remove_%E2%80%9Cplan_b%E2%80%9D

Signed-off-by: Tim Krüger <t@timkrueger.me>
2022-02-23 11:34:30 +01:00

369 lines
14 KiB
Groovy

/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* @author Marcel Hibbe
* @author Tim Krüger
* Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
* Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import com.github.spotbugs.snom.SpotBugsTask
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.github.spotbugs'
apply plugin: 'io.gitlab.arturbosch.detekt'
configurations {
ktlint
}
def urlFile = { url, fileName ->
File file = new File("$buildDir/download/${fileName}")
file.parentFile.mkdirs()
if (!file.exists()) {
new URL(url).withInputStream { downloadStream ->
file.withOutputStream { fileOut ->
fileOut << downloadStream
}
}
}
files(file.absolutePath)
}
android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable)
// xx .xxx .xx .xx
versionCode 130010013
versionName "13.1.0 Alpha 13"
flavorDimensions "default"
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
productFlavors {
// used for f-droid
generic {
applicationId 'com.nextcloud.talk2'
dimension "default"
}
gplay {
applicationId 'com.nextcloud.talk2'
dimension "default"
}
qa {
applicationId "com.nextcloud.talk2.qa"
dimension "default"
versionCode 1
versionName "1"
}
}
// Enabling multidex support.
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
lintOptions {
disable 'InvalidPackage'
disable 'MissingTranslation'
disable 'VectorPath'
}
javaCompileOptions {
annotationProcessorOptions {
arguments = [
parcelerStacktrace: "true"
]
}
}
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/rxjava.properties'
}
android.applicationVariants.all { variant ->
String variantName = variant.name
String capVariantName = variantName.substring(0, 1).toUpperCase(Locale.ROOT) + variantName.substring(1)
tasks.register("spotbugs${capVariantName}Report", SpotBugsTask) {
ignoreFailures = true // should continue checking
effort = "max"
reportLevel = "medium"
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
reports {
xml.enabled = false
html {
enabled = true
destination = file("$project.buildDir/reports/spotbugs/spotbugs.html")
}
}
}
}
check.dependsOn 'spotbugsGplayDebugReport', 'lint', 'ktlint', 'detekt'
lint.dependsOn 'preBuild'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
htmlReport true
htmlOutput file("$project.buildDir/reports/lint/lint.html")
disable 'MissingTranslation'
}
buildFeatures {
viewBinding true
}
}
ext {
butterknifeVersion = "10.2.3"
coilKtVersion = "1.4.0"
daggerVersion = "2.41"
okhttpVersion = "4.9.3"
materialDialogsVersion = "3.3.0"
parcelerVersion = "1.1.13"
powermockVersion = "2.0.9"
retrofit2Version = "2.9.0"
workVersion = "2.6.0"
markwonVersion = "4.6.2"
espressoVersion = "3.4.0"
}
configurations.all {
exclude group: 'com.google.firebase', module: 'firebase-core'
exclude group: 'com.google.firebase', module: 'firebase-analytics'
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
}
dependencies {
implementation fileTree(include: ['*'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'com.github.vanniktech:Emoji:0.6.0' // 0.7.0 has display issue - don't update to 0.7.0
implementation group: 'androidx.emoji', name: 'emoji-bundled', version: '1.1.0'
implementation 'org.michaelevans.colorart:library:0.0.3'
implementation "androidx.work:work-runtime:${workVersion}"
implementation "androidx.work:work-rxjava2:${workVersion}"
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
androidTestImplementation "androidx.work:work-testing:${workVersion}"
implementation 'com.google.android:flexbox:2.0.1'
implementation ('com.gitlab.bitfireAT:dav4jvm:2.1.3', {
exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser
})
ktlint "com.pinterest:ktlint:0.44.0"
implementation 'org.conscrypt:conscrypt-android:2.5.2'
implementation 'androidx.camera:camera-core:1.0.2'
implementation 'androidx.camera:camera-camera2:1.0.2'
implementation 'androidx.camera:camera-lifecycle:1.0.2'
implementation 'androidx.camera:camera-view:1.0.0-alpha28'
implementation "androidx.exifinterface:exifinterface:1.3.3"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.biometric:biometric:1.1.0'
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation "io.reactivex.rxjava2:rxjava:2.2.21"
implementation 'com.bluelinelabs:conductor:3.1.4'
implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
implementation "com.squareup.okhttp3:okhttp-urlconnection:${okhttpVersion}"
implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
implementation 'com.bluelinelabs:logansquare:1.3.7'
implementation 'com.fasterxml.jackson.core:jackson-core:2.13.1'
kapt 'com.bluelinelabs:logansquare-compiler:1.3.7'
implementation "com.squareup.retrofit2:retrofit:${retrofit2Version}"
implementation "com.squareup.retrofit2:adapter-rxjava2:${retrofit2Version}"
implementation 'com.github.aurae.retrofit2:converter-logansquare:1.4.1'
implementation "com.google.dagger:dagger:${daggerVersion}"
kapt "com.google.dagger:dagger-compiler:${daggerVersion}"
implementation 'com.github.lukaspili.autodagger2:autodagger2:1.1'
kapt 'com.github.lukaspili.autodagger2:autodagger2-compiler:1.1'
compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
// Android only
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'io.requery:requery:1.6.1'
implementation 'io.requery:requery-android:1.6.1'
implementation 'net.zetetic:android-database-sqlcipher:3.5.9'
kapt 'io.requery:requery-processor:1.6.1'
implementation "org.parceler:parceler-api:$parcelerVersion"
kapt "org.parceler:parceler:$parcelerVersion"
implementation 'net.orange-box.storebox:storebox-lib:1.4.0'
implementation "com.jakewharton:butterknife:${butterknifeVersion}"
kapt "com.jakewharton:butterknife-compiler:${butterknifeVersion}"
implementation 'eu.davidea:flexible-adapter:5.1.0'
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
implementation urlFile('https://github.com/nextcloud-releases/talk-clients-webrtc/releases/download/96.4664.0-RC1/libwebrtc-96.4664.0.aar',
'libwebrtc-96.4664.0.aar')
implementation 'com.yarolegovich:lovely-dialog:1.1.1'
implementation 'com.yarolegovich:mp:1.1.6'
implementation 'me.zhanghai.android.effortlesspermissions:library:1.1.0'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'com.github.wooplr:Spotlight:1.3'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation('com.github.nextcloud:ChatKit:c6a6176729', {
exclude group: 'com.facebook.fresco'
})
implementation 'com.github.nextcloud.fresco:fresco:v111'
implementation 'com.github.nextcloud.fresco:animated-webp:v111'
implementation 'com.github.nextcloud.fresco:webpsupport:v111'
implementation 'com.github.nextcloud.fresco:animated-gif:v111'
implementation 'com.github.nextcloud.fresco:imagepipeline-okhttp3:v111'
implementation 'joda-time:joda-time:2.10.13'
implementation "io.coil-kt:coil:${coilKtVersion}"
implementation "io.coil-kt:coil-gif:${coilKtVersion}"
implementation "io.coil-kt:coil-svg:${coilKtVersion}"
implementation 'com.github.natario1:Autocomplete:v1.1.0'
implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:2.4.5'
implementation 'com.novoda:merlin:1.2.1'
implementation 'com.github.nextcloud:PopupBubble:1.0.6'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation "com.afollestad.material-dialogs:core:${materialDialogsVersion}"
implementation "com.afollestad.material-dialogs:datetime:${materialDialogsVersion}"
implementation "com.afollestad.material-dialogs:bottomsheets:${materialDialogsVersion}"
implementation "com.afollestad.material-dialogs:lifecycle:${materialDialogsVersion}"
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.google.android.exoplayer:exoplayer:2.16.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'
implementation "io.noties.markwon:core:$markwonVersion"
//implementation 'com.github.dhaval2404:imagepicker:1.8'
implementation 'com.github.tobiaskaminsky:ImagePicker:1.8.0.2'
implementation 'com.elyeproj.libraries:loaderviewlibrary:2.0.0'
implementation 'org.osmdroid:osmdroid-android:6.1.11'
implementation ('fr.dudie:nominatim-api:3.4', {
//noinspection DuplicatePlatformClasses
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
})
implementation 'androidx.core:core-ktx:1.6.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation "org.powermock:powermock-core:${powermockVersion}"
testImplementation "org.powermock:powermock-module-junit4:${powermockVersion}"
testImplementation "org.powermock:powermock-api-mockito2:${powermockVersion}"
androidTestImplementation "androidx.test:core:1.4.0"
// Espresso core
androidTestImplementation ("androidx.test.espresso:espresso-core:$espressoVersion", {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-accessibility:$espressoVersion"
androidTestImplementation('com.android.support.test.espresso:espresso-intents:3.0.2')
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0'
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7'
gplayImplementation 'com.google.android.gms:play-services-base:18.0.1'
gplayImplementation "com.google.firebase:firebase-messaging:23.0.0"
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "--reporter=plain", "--reporter=plain,output=${buildDir}/ktlint.txt,src/**/*.kt"
}
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
detekt {
reports {
xml {
enabled = false
}
}
config = files("../detekt.yml")
input = files("src/")
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}