From c89b2c05367cca644d7dcf4c0d05bbc6dbc32be7 Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Wed, 15 Sep 2021 12:28:58 +0300 Subject: [PATCH 1/3] Optimize dependencies handling --- attachment-viewer/build.gradle | 19 +++++----- build.gradle | 11 +++--- dependencies.gradle | 49 ++++++++++++++++++++++++++ library/ui-styles/build.gradle | 12 +++---- matrix-sdk-android-rx/build.gradle | 20 +++++------ matrix-sdk-android/build.gradle | 56 +++++++++++++----------------- multipicker/build.gradle | 13 ++++--- vector/build.gradle | 54 +++++++++++++--------------- 8 files changed, 137 insertions(+), 97 deletions(-) create mode 100644 dependencies.gradle diff --git a/attachment-viewer/build.gradle b/attachment-viewer/build.gradle index 82e208d47e..76a79544bf 100644 --- a/attachment-viewer/build.gradle +++ b/attachment-viewer/build.gradle @@ -18,11 +18,12 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdk 30 + + compileSdk versions.compileSdk defaultConfig { - minSdk 21 - targetSdk 30 + minSdk versions.minSdk + targetSdk versions.targetSdk } buildTypes { @@ -32,8 +33,8 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility versions.sourceCompat + targetCompatibility versions.targetCompat } kotlinOptions { jvmTarget = "11" @@ -49,12 +50,12 @@ dependencies { implementation 'com.github.chrisbanes:PhotoView:2.3.0' - implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0' - implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' + implementation libs.rx.rxKotlin + implementation libs.rx.rxAndroid - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}" implementation 'androidx.core:core-ktx:1.6.0' - implementation 'androidx.appcompat:appcompat:1.3.1' + implementation libs.androidx.appCompat implementation "androidx.recyclerview:recyclerview:1.2.1" implementation 'com.google.android.material:material:1.4.0' diff --git a/build.gradle b/build.gradle index 800c4a713b..49c3e07ece 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,9 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - // Ref: https://kotlinlang.org/releases.html - ext.kotlin_version = '1.5.30' - ext.kotlin_coroutines_version = "1.5.1" + + apply from: 'dependencies.gradle' + repositories { google() jcenter() @@ -11,12 +11,13 @@ buildscript { url "https://plugins.gradle.org/m2/" } } + dependencies { // Release notes of Android Gradle Plugin (AGP): // https://developer.android.com/studio/releases/gradle-plugin - classpath 'com.android.tools.build:gradle:7.0.2' + classpath libs.gradle.gradlePlugin + classpath libs.gradle.kotlinPlugin classpath 'com.google.gms:google-services:4.3.10' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3' classpath 'com.google.android.gms:oss-licenses-plugin:0.10.4' classpath "com.likethesalad.android:string-reference:1.2.2" diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 0000000000..532f5ff683 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,49 @@ +ext.versions = [ + + 'minSdk' : 21, + 'compileSdk' : 30, + 'targetSdk' : 30, + 'sourceCompat' : JavaVersion.VERSION_11, + 'targetCompat' : JavaVersion.VERSION_11, + + 'kotlin' : '1.5.30', + 'kotlinCoroutines' : '1.5.1', + 'dagger' : '2.38.1', + 'timber' : '5.0.1', + 'work' : '2.5.0', + 'lifecycle' : '2.2.0', + 'moshi' : '1.12.0', + 'arch' : '2.1.0', + 'markwon' : '4.6.2', + 'arrow' : '0.8.2', + 'rxKotlin' : '2.4.0', + 'rxAndroid' : '2.1.1', + +] + +ext.libs = [ + gradle : [ + 'gradlePlugin' : "com.android.tools.build:gradle:7.0.2", + 'kotlinPlugin' : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin" + ], + jetbrains : [ + 'kotlinStdlib' : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}", + 'coroutinesCore' : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinCoroutines}", + 'coroutinesAndroid' : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.kotlinCoroutines}", + 'coroutinesRx2' : "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:${versions.kotlinCoroutines}" + ], + androidx : [ + 'appCompat' : "androidx.appcompat:appcompat:1.3.1" + ], + dagger : [ + 'dagger' : "com.google.dagger:dagger:${versions.dagger}", + 'daggerCompiler' : "com.google.dagger:dagger-compiler:${versions.dagger}" + ], + rx : [ + 'rxKotlin' : "io.reactivex.rxjava2:rxkotlin:${versions.rxKotlin}", + 'rxAndroid' : "io.reactivex.rxjava2:rxandroid:${versions.rxAndroid}" + ], + jakewharton : [ + 'timber' : "com.jakewharton.timber:timber:${versions.timber}", + ] +] \ No newline at end of file diff --git a/library/ui-styles/build.gradle b/library/ui-styles/build.gradle index 069becba0d..5985a5d95a 100644 --- a/library/ui-styles/build.gradle +++ b/library/ui-styles/build.gradle @@ -20,11 +20,11 @@ plugins { } android { - compileSdk 30 + compileSdk versions.compileSdk defaultConfig { - minSdk 21 - targetSdk 30 + minSdk versions.minSdk + targetSdk versions.targetSdk testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -38,8 +38,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility versions.sourceCompat + targetCompatibility versions.targetCompat } kotlinOptions { @@ -52,7 +52,7 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.3.1' + implementation libs.androidx.appCompat implementation 'com.google.android.material:material:1.4.0' // Pref theme implementation 'androidx.preference:preference-ktx:1.1.1' diff --git a/matrix-sdk-android-rx/build.gradle b/matrix-sdk-android-rx/build.gradle index 0d2ddee2e0..602a9e0506 100644 --- a/matrix-sdk-android-rx/build.gradle +++ b/matrix-sdk-android-rx/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { - compileSdk 30 + compileSdk versions.compileSdk defaultConfig { - minSdk 21 - targetSdk 30 + minSdk versions.minSdk + targetSdk versions.targetSdk // Multidex is useful for tests multiDexEnabled true @@ -22,8 +22,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility versions.sourceCompat + targetCompatibility versions.targetCompat } kotlinOptions { @@ -33,14 +33,14 @@ android { dependencies { implementation project(":matrix-sdk-android") - implementation 'androidx.appcompat:appcompat:1.3.1' - implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0' - implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$kotlin_coroutines_version" + implementation libs.androidx.appCompat + implementation libs.rx.rxKotlin + implementation libs.rx.rxAndroid + implementation libs.jetbrains.coroutinesRx2 // Paging implementation "androidx.paging:paging-runtime-ktx:2.1.2" // Logging - implementation 'com.jakewharton.timber:timber:5.0.1' + implementation libs.jakewharton.timber } diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 5da7fd9885..1a228472db 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -14,12 +14,13 @@ buildscript { } android { - compileSdk 30 testOptions.unitTests.includeAndroidResources = true + compileSdk versions.compileSdk + defaultConfig { - minSdk 21 - targetSdk 30 + minSdk versions.minSdk + targetSdk versions.targetSdk // Multidex is useful for tests multiDexEnabled true @@ -65,8 +66,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility versions.sourceCompat + targetCompatibility versions.targetCompat } kotlinOptions { @@ -100,24 +101,17 @@ static def gitRevisionDate() { dependencies { - def arrow_version = "0.8.2" - def moshi_version = '1.12.0' - def lifecycle_version = '2.2.0' - def arch_version = '2.1.0' - def markwon_version = '3.1.0' - def daggerVersion = '2.38.1' - def work_version = '2.5.0' def retrofit_version = '2.9.0' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" + implementation libs.jetbrains.kotlinStdlib + implementation libs.jetbrains.coroutinesCore + implementation libs.jetbrains.coroutinesAndroid - implementation "androidx.appcompat:appcompat:1.3.1" + implementation libs.androidx.appCompat implementation "androidx.core:core-ktx:1.6.0" - implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" - implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" + implementation "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}" + implementation "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle}" // Network implementation "com.squareup.retrofit2:retrofit:$retrofit_version" @@ -128,10 +122,10 @@ dependencies { implementation 'com.squareup.okhttp3:logging-interceptor' implementation 'com.squareup.okhttp3:okhttp-urlconnection' - implementation "com.squareup.moshi:moshi-adapters:$moshi_version" - kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version" + implementation "com.squareup.moshi:moshi-adapters:${versions.moshi}" + kapt "com.squareup.moshi:moshi-kotlin-codegen:${versions.moshi}" - implementation "ru.noties.markwon:core:$markwon_version" + implementation "io.noties.markwon:core:${versions.markwon}" // Image implementation 'androidx.exifinterface:exifinterface:1.3.3' @@ -141,21 +135,21 @@ dependencies { kapt 'dk.ilios:realmfieldnameshelper:2.0.0' // Work - implementation "androidx.work:work-runtime-ktx:$work_version" + implementation "androidx.work:work-runtime-ktx:${versions.work}" // FP - implementation "io.arrow-kt:arrow-core:$arrow_version" - implementation "io.arrow-kt:arrow-instances-core:$arrow_version" + implementation "io.arrow-kt:arrow-core:${versions.arrow}" + implementation "io.arrow-kt:arrow-instances-core:${versions.arrow}" // olm lib is now hosted by jitpack: https://jitpack.io/#org.matrix.gitlab.matrix-org/olm implementation 'org.matrix.gitlab.matrix-org:olm:3.2.4' // DI - implementation "com.google.dagger:dagger:$daggerVersion" - kapt "com.google.dagger:dagger-compiler:$daggerVersion" + implementation libs.dagger.dagger + kapt libs.dagger.daggerCompiler // Logging - implementation 'com.jakewharton.timber:timber:5.0.1' + implementation libs.jakewharton.timber implementation 'com.facebook.stetho:stetho-okhttp3:1.6.0' // Video compression @@ -170,11 +164,11 @@ dependencies { // Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281 testImplementation 'io.mockk:mockk:1.12.0' testImplementation 'org.amshove.kluent:kluent-android:1.68' - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" + implementation libs.jetbrains.coroutinesAndroid // Plant Timber tree for test testImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' - kaptAndroidTest "com.google.dagger:dagger-compiler:$daggerVersion" + kaptAndroidTest libs.dagger.daggerCompiler androidTestImplementation 'androidx.test:core:1.4.0' androidTestImplementation 'androidx.test:runner:1.4.0' androidTestImplementation 'androidx.test:rules:1.4.0' @@ -182,8 +176,8 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation 'org.amshove.kluent:kluent-android:1.68' androidTestImplementation 'io.mockk:mockk-android:1.12.0' - androidTestImplementation "androidx.arch.core:core-testing:$arch_version" - androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" + androidTestImplementation "androidx.arch.core:core-testing:${versions.arch}" + androidTestImplementation libs.jetbrains.coroutinesAndroid // Plant Timber tree for test androidTestImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' diff --git a/multipicker/build.gradle b/multipicker/build.gradle index 64460f6721..be86963868 100644 --- a/multipicker/build.gradle +++ b/multipicker/build.gradle @@ -19,12 +19,11 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-parcelize' android { - compileSdk 30 + compileSdk versions.compileSdk defaultConfig { - minSdk 19 - targetSdk 30 - + minSdk versions.minSdk + targetSdk versions.targetSdk testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' } @@ -39,11 +38,11 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.3.1' + implementation libs.jetbrains.kotlinStdlib + implementation libs.androidx.appCompat implementation "androidx.fragment:fragment-ktx:1.3.6" implementation 'androidx.exifinterface:exifinterface:1.3.3' // Log - implementation 'com.jakewharton.timber:timber:5.0.1' + implementation libs.jakewharton.timber } diff --git a/vector/build.gradle b/vector/build.gradle index d65463bec2..cb9824287a 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -102,17 +102,20 @@ ext.abiVersionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2, "x86": 3, "x86_64": 4]. def buildNumber = System.env.BUILDKITE_BUILD_NUMBER as Integer ?: 0 android { - compileSdk 30 + + // Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use // Ref: https://issuetracker.google.com/issues/144111441 ndkVersion "21.3.6528147" + compileSdk versions.compileSdk + defaultConfig { applicationId "im.vector.app" // Set to API 21: see #405 - minSdk 21 - targetSdk 30 + minSdk versions.minSdk + targetSdk versions.targetSdk multiDexEnabled true renderscriptTargetApi 24 @@ -289,8 +292,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility versions.sourceCompat + targetCompatibility versions.targetCompat } kotlinOptions { @@ -315,16 +318,9 @@ dependencies { def epoxy_version = '4.6.2' def fragment_version = '1.3.6' - def arrow_version = "0.8.2" - def markwon_version = '4.1.2' def big_image_viewer_version = '1.8.1' def glide_version = '4.12.0' - def moshi_version = '1.12.0' - def daggerVersion = '2.38.1' def autofill_version = "1.1.0" - def work_version = '2.5.0' - def arch_version = '2.1.0' - def lifecycle_version = '2.2.0' def rxbinding_version = '3.1.0' def jjwt_version = '0.11.2' @@ -341,12 +337,12 @@ dependencies { implementation project(":library:ui-styles") implementation 'androidx.multidex:multidex:2.0.1' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" + implementation libs.jetbrains.kotlinStdlib + implementation libs.jetbrains.coroutinesCore + implementation libs.jetbrains.coroutinesAndroid implementation "androidx.recyclerview:recyclerview:1.2.1" - implementation 'androidx.appcompat:appcompat:1.3.1' + implementation libs.androidx.appCompat implementation "androidx.fragment:fragment-ktx:$fragment_version" implementation 'androidx.constraintlayout:constraintlayout:2.1.0' implementation "androidx.sharetarget:sharetarget:1.1.0" @@ -357,13 +353,13 @@ dependencies { implementation "org.threeten:threetenbp:1.4.0:no-tzdb" implementation "com.gabrielittner.threetenbp:lazythreetenbp:0.9.0" - implementation "com.squareup.moshi:moshi-adapters:$moshi_version" - implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" + implementation "com.squareup.moshi:moshi-adapters:${versions.moshi}" + implementation "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}" implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1" - kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version" + kapt "com.squareup.moshi:moshi-kotlin-codegen:${versions.moshi}" // Log - implementation 'com.jakewharton.timber:timber:5.0.1' + implementation libs.jakewharton.timber // Debug implementation 'com.facebook.stetho:stetho:1.6.0' @@ -372,8 +368,8 @@ dependencies { implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.32' // rx - implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0' - implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' + implementation libs.rx.rxKotlin + implementation libs.rx.rxAndroid implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1' // RXBinding implementation "com.jakewharton.rxbinding3:rxbinding:$rxbinding_version" @@ -387,13 +383,13 @@ dependencies { implementation 'com.airbnb.android:mvrx:1.5.1' // Work - implementation "androidx.work:work-runtime-ktx:$work_version" + implementation "androidx.work:work-runtime-ktx:${versions.work}" // Paging implementation "androidx.paging:paging-runtime-ktx:2.1.2" // Functional Programming - implementation "io.arrow-kt:arrow-core:$arrow_version" + implementation "io.arrow-kt:arrow-core:${versions.arrow}" // Pref implementation 'androidx.preference:preference-ktx:1.1.1' @@ -402,8 +398,8 @@ dependencies { implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1' implementation 'com.google.android.material:material:1.4.0' implementation 'me.gujun.android:span:1.7' - implementation "io.noties.markwon:core:$markwon_version" - implementation "io.noties.markwon:html:$markwon_version" + implementation "io.noties.markwon:core:${versions.markwon}" + implementation "io.noties.markwon:html:${versions.markwon}" implementation 'com.googlecode.htmlcompressor:htmlcompressor:1.5.2' implementation 'me.saket:better-link-movement-method:2.2.0' implementation 'com.google.android:flexbox:2.0.1' @@ -451,8 +447,8 @@ dependencies { implementation 'nl.dionsegijn:konfetti:1.3.2' implementation 'com.github.jetradarmobile:android-snowfall:1.2.1' // DI - implementation "com.google.dagger:dagger:$daggerVersion" - kapt "com.google.dagger:dagger-compiler:$daggerVersion" + implementation libs.dagger.dagger + kapt libs.dagger.daggerCompiler // gplay flavor only gplayImplementation('com.google.firebase:firebase-messaging:22.0.0') { @@ -517,7 +513,7 @@ dependencies { androidTestImplementation "androidx.test.espresso:espresso-contrib:$espresso_version" androidTestImplementation "androidx.test.espresso:espresso-intents:$espresso_version" androidTestImplementation "org.amshove.kluent:kluent-android:$kluent_version" - androidTestImplementation "androidx.arch.core:core-testing:$arch_version" + androidTestImplementation "androidx.arch.core:core-testing:${versions.arch}" // Plant Timber tree for test androidTestImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' // "The one who serves a great Espresso" From 87fefdc7bb3a3df533d1d91470b49ff2b4b9cb2b Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Wed, 15 Sep 2021 20:22:52 +0300 Subject: [PATCH 2/3] Add more dependencies to common dependencies.gradle --- attachment-viewer/build.gradle | 4 +- dependencies.gradle | 28 ++++++++++-- matrix-sdk-android/build.gradle | 24 +++++----- multipicker/build.gradle | 4 +- vector/build.gradle | 77 ++++++++++++++------------------- 5 files changed, 72 insertions(+), 65 deletions(-) diff --git a/attachment-viewer/build.gradle b/attachment-viewer/build.gradle index 76a79544bf..aa0e48bc52 100644 --- a/attachment-viewer/build.gradle +++ b/attachment-viewer/build.gradle @@ -54,9 +54,9 @@ dependencies { implementation libs.rx.rxAndroid implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}" - implementation 'androidx.core:core-ktx:1.6.0' + implementation libs.androidx.core implementation libs.androidx.appCompat - implementation "androidx.recyclerview:recyclerview:1.2.1" + implementation libs.androidx.recyclerview implementation 'com.google.android.material:material:1.4.0' } \ No newline at end of file diff --git a/dependencies.gradle b/dependencies.gradle index 532f5ff683..440bc2f654 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -6,11 +6,11 @@ ext.versions = [ 'sourceCompat' : JavaVersion.VERSION_11, 'targetCompat' : JavaVersion.VERSION_11, + // Ref: https://kotlinlang.org/releases.html 'kotlin' : '1.5.30', 'kotlinCoroutines' : '1.5.1', 'dagger' : '2.38.1', 'timber' : '5.0.1', - 'work' : '2.5.0', 'lifecycle' : '2.2.0', 'moshi' : '1.12.0', 'arch' : '2.1.0', @@ -18,6 +18,17 @@ ext.versions = [ 'arrow' : '0.8.2', 'rxKotlin' : '2.4.0', 'rxAndroid' : '2.1.1', + 'retrofit' : '2.9.0', + 'epoxy' : '4.6.2', + 'glide' : '4.12.0', + 'rxBinding' : '3.1.0', + 'bigImageViwer' : '1.8.1', + 'jjwt' : '0.11.2', + 'kluent' : '1.68', + 'androidxTest' : '1.4.0', + 'espresso' : '3.4.0' + + ] @@ -33,7 +44,15 @@ ext.libs = [ 'coroutinesRx2' : "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:${versions.kotlinCoroutines}" ], androidx : [ - 'appCompat' : "androidx.appcompat:appcompat:1.3.1" + 'appCompat' : "androidx.appcompat:appcompat:1.3.1", + 'core' : "androidx.core:core-ktx:1.6.0", + 'recyclerview' : "androidx.recyclerview:recyclerview:1.2.1", + 'exifinterface' : "androidx.exifinterface:exifinterface:1.3.3", + 'fragmentKtx' : "androidx.fragment:fragment-ktx:1.3.6", + 'constraintLayout' : "androidx.constraintlayout:constraintlayout:2.1.0", + 'work' : "androidx.work:work-runtime-ktx:2.5.0", + 'autoFill' : "androidx.autofill:autofill:1.1.0", + 'junit' : "androidx.test.ext:junit:1.1.3" ], dagger : [ 'dagger' : "com.google.dagger:dagger:${versions.dagger}", @@ -44,6 +63,9 @@ ext.libs = [ 'rxAndroid' : "io.reactivex.rxjava2:rxandroid:${versions.rxAndroid}" ], jakewharton : [ - 'timber' : "com.jakewharton.timber:timber:${versions.timber}", + 'timber' : "com.jakewharton.timber:timber:${versions.timber}" + ], + tests : [ + 'junit' : "junit:junit:4.13.2" ] ] \ No newline at end of file diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 1a228472db..0884c9d878 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -101,21 +101,19 @@ static def gitRevisionDate() { dependencies { - def retrofit_version = '2.9.0' - implementation libs.jetbrains.kotlinStdlib implementation libs.jetbrains.coroutinesCore implementation libs.jetbrains.coroutinesAndroid implementation libs.androidx.appCompat - implementation "androidx.core:core-ktx:1.6.0" + implementation libs.androidx.core implementation "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}" implementation "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle}" // Network - implementation "com.squareup.retrofit2:retrofit:$retrofit_version" - implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version" + implementation "com.squareup.retrofit2:retrofit:${versions.retrofit}" + implementation "com.squareup.retrofit2:converter-moshi:${versions.retrofit}" implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.1")) implementation 'com.squareup.okhttp3:okhttp' @@ -128,14 +126,14 @@ dependencies { implementation "io.noties.markwon:core:${versions.markwon}" // Image - implementation 'androidx.exifinterface:exifinterface:1.3.3' + implementation libs.androidx.exifinterface // Database implementation 'com.github.Zhuinden:realm-monarchy:0.7.1' kapt 'dk.ilios:realmfieldnameshelper:2.0.0' // Work - implementation "androidx.work:work-runtime-ktx:${versions.work}" + implementation libs.androidx.work // FP implementation "io.arrow-kt:arrow-core:${versions.arrow}" @@ -158,7 +156,7 @@ dependencies { // Phone number https://github.com/google/libphonenumber implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.32' - testImplementation 'junit:junit:4.13.2' + testImplementation libs.tests.junit testImplementation 'org.robolectric:robolectric:4.6.1' //testImplementation 'org.robolectric:shadows-support-v4:3.0' // Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281 @@ -169,11 +167,11 @@ dependencies { testImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' kaptAndroidTest libs.dagger.daggerCompiler - androidTestImplementation 'androidx.test:core:1.4.0' - androidTestImplementation 'androidx.test:runner:1.4.0' - androidTestImplementation 'androidx.test:rules:1.4.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + androidTestImplementation "androidx.test:core:${versions.androidxTest}" + androidTestImplementation "androidx.test:runner:${versions.androidxTest}" + androidTestImplementation "androidx.test:rules:${versions.androidxTest}" + androidTestImplementation libs.androidx.junit + androidTestImplementation "androidx.test.espresso:espresso-core:${versions.espresso}" androidTestImplementation 'org.amshove.kluent:kluent-android:1.68' androidTestImplementation 'io.mockk:mockk-android:1.12.0' androidTestImplementation "androidx.arch.core:core-testing:${versions.arch}" diff --git a/multipicker/build.gradle b/multipicker/build.gradle index be86963868..8d37ec7ecf 100644 --- a/multipicker/build.gradle +++ b/multipicker/build.gradle @@ -40,8 +40,8 @@ android { dependencies { implementation libs.jetbrains.kotlinStdlib implementation libs.androidx.appCompat - implementation "androidx.fragment:fragment-ktx:1.3.6" - implementation 'androidx.exifinterface:exifinterface:1.3.3' + implementation libs.androidx.fragmentKtx + implementation libs.androidx.exifinterface // Log implementation libs.jakewharton.timber diff --git a/vector/build.gradle b/vector/build.gradle index cb9824287a..37995d9e8a 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -316,19 +316,6 @@ android { dependencies { - def epoxy_version = '4.6.2' - def fragment_version = '1.3.6' - def big_image_viewer_version = '1.8.1' - def glide_version = '4.12.0' - def autofill_version = "1.1.0" - def rxbinding_version = '3.1.0' - def jjwt_version = '0.11.2' - - // Tests - def kluent_version = '1.68' - def androidxTest_version = '1.4.0' - def espresso_version = '3.4.0' - implementation project(":matrix-sdk-android") implementation project(":matrix-sdk-android-rx") implementation project(":diff-match-patch") @@ -341,12 +328,12 @@ dependencies { implementation libs.jetbrains.coroutinesCore implementation libs.jetbrains.coroutinesAndroid - implementation "androidx.recyclerview:recyclerview:1.2.1" + implementation libs.androidx.recyclerview implementation libs.androidx.appCompat - implementation "androidx.fragment:fragment-ktx:$fragment_version" - implementation 'androidx.constraintlayout:constraintlayout:2.1.0' + implementation libs.androidx.fragmentKtx + implementation libs.androidx.constraintLayout implementation "androidx.sharetarget:sharetarget:1.1.0" - implementation 'androidx.core:core-ktx:1.6.0' + implementation libs.androidx.core implementation "androidx.media:media:1.4.1" implementation "androidx.transition:transition:1.4.1" @@ -372,18 +359,18 @@ dependencies { implementation libs.rx.rxAndroid implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1' // RXBinding - implementation "com.jakewharton.rxbinding3:rxbinding:$rxbinding_version" - implementation "com.jakewharton.rxbinding3:rxbinding-appcompat:$rxbinding_version" - implementation "com.jakewharton.rxbinding3:rxbinding-material:$rxbinding_version" + implementation "com.jakewharton.rxbinding3:rxbinding:${versions.rxBinding}" + implementation "com.jakewharton.rxbinding3:rxbinding-appcompat:${versions.rxBinding}" + implementation "com.jakewharton.rxbinding3:rxbinding-material:${versions.rxBinding}" - implementation("com.airbnb.android:epoxy:$epoxy_version") - implementation "com.airbnb.android:epoxy-glide-preloading:$epoxy_version" - kapt "com.airbnb.android:epoxy-processor:$epoxy_version" - implementation "com.airbnb.android:epoxy-paging:$epoxy_version" + implementation("com.airbnb.android:epoxy:${versions.epoxy}") + implementation "com.airbnb.android:epoxy-glide-preloading:${versions.epoxy}" + kapt "com.airbnb.android:epoxy-processor:${versions.epoxy}" + implementation "com.airbnb.android:epoxy-paging:${versions.epoxy}" implementation 'com.airbnb.android:mvrx:1.5.1' // Work - implementation "androidx.work:work-runtime-ktx:${versions.work}" + implementation libs.androidx.work // Paging implementation "androidx.paging:paging-runtime-ktx:2.1.2" @@ -403,7 +390,7 @@ dependencies { implementation 'com.googlecode.htmlcompressor:htmlcompressor:1.5.2' implementation 'me.saket:better-link-movement-method:2.2.0' implementation 'com.google.android:flexbox:2.0.1' - implementation "androidx.autofill:autofill:$autofill_version" + implementation libs.androidx.autoFill implementation 'jp.wasabeef:glide-transformations:4.3.0' implementation 'com.github.vector-im:PFLockScreen-Android:1.0.0-beta12' implementation 'com.github.hyuwah:DraggableView:1.0.0' @@ -427,16 +414,16 @@ dependencies { implementation 'com.squareup:seismic:1.0.2' // Image Loading - implementation "com.github.piasy:BigImageViewer:$big_image_viewer_version" - implementation "com.github.piasy:GlideImageLoader:$big_image_viewer_version" - implementation "com.github.piasy:ProgressPieIndicator:$big_image_viewer_version" - implementation "com.github.piasy:GlideImageViewFactory:$big_image_viewer_version" + implementation "com.github.piasy:BigImageViewer:${versions.bigImageViwer}" + implementation "com.github.piasy:GlideImageLoader:${versions.bigImageViwer}" + implementation "com.github.piasy:ProgressPieIndicator:${versions.bigImageViwer}" + implementation "com.github.piasy:GlideImageViewFactory:${versions.bigImageViwer}" // implementation 'com.github.MikeOrtiz:TouchImageView:3.0.2' implementation 'com.github.chrisbanes:PhotoView:2.3.0' - implementation "com.github.bumptech.glide:glide:$glide_version" - kapt "com.github.bumptech.glide:compiler:$glide_version" + implementation "com.github.bumptech.glide:glide:${versions.glide}" + kapt "com.github.bumptech.glide:compiler:${versions.glide}" implementation 'com.danikula:videocache:2.7.1' implementation 'com.github.yalantis:ucrop:2.2.7' @@ -488,31 +475,31 @@ dependencies { implementation 'im.dlg:android-dialer:1.2.5' // JWT - api "io.jsonwebtoken:jjwt-api:$jjwt_version" - runtimeOnly "io.jsonwebtoken:jjwt-impl:$jjwt_version" - runtimeOnly("io.jsonwebtoken:jjwt-orgjson:$jjwt_version") { + api "io.jsonwebtoken:jjwt-api:${versions.jjwt}" + runtimeOnly "io.jsonwebtoken:jjwt-impl:${versions.jjwt}" + runtimeOnly("io.jsonwebtoken:jjwt-orgjson:${versions.jjwt}") { exclude group: 'org.json', module: 'json' //provided by Android natively } implementation 'commons-codec:commons-codec:1.15' // TESTS - testImplementation 'junit:junit:4.13.2' - testImplementation "org.amshove.kluent:kluent-android:$kluent_version" + testImplementation libs.tests.junit + testImplementation "org.amshove.kluent:kluent-android:${versions.kluent}" // Plant Timber tree for test testImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' // Activate when you want to check for leaks, from time to time. //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.3' - androidTestImplementation "androidx.test:core:$androidxTest_version" - androidTestImplementation "androidx.test:runner:$androidxTest_version" - androidTestImplementation "androidx.test:rules:$androidxTest_version" - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version" - androidTestImplementation "androidx.test.espresso:espresso-contrib:$espresso_version" - androidTestImplementation "androidx.test.espresso:espresso-intents:$espresso_version" - androidTestImplementation "org.amshove.kluent:kluent-android:$kluent_version" + androidTestImplementation "androidx.test:core:${versions.androidxTest}" + androidTestImplementation "androidx.test:runner:${versions.androidxTest}" + androidTestImplementation "androidx.test:rules:${versions.androidxTest}" + androidTestImplementation libs.androidx.junit + androidTestImplementation "androidx.test.espresso:espresso-core:${versions.espresso}" + androidTestImplementation "androidx.test.espresso:espresso-contrib:${versions.espresso}" + androidTestImplementation "androidx.test.espresso:espresso-intents:${versions.espresso}" + androidTestImplementation "org.amshove.kluent:kluent-android:${versions.kluent}" androidTestImplementation "androidx.arch.core:core-testing:${versions.arch}" // Plant Timber tree for test androidTestImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' From 1dcf6b95392937a4a8b1ea50d11749f790abf3bf Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Fri, 17 Sep 2021 14:58:44 +0300 Subject: [PATCH 3/3] Enhance dependencies handling to support Dependabot --- attachment-viewer/build.gradle | 4 +- dependencies.gradle | 144 ++++++++++++++++++++--------- library/ui-styles/build.gradle | 4 +- matrix-sdk-android-rx/build.gradle | 3 +- matrix-sdk-android/build.gradle | 40 ++++---- multipicker/build.gradle | 2 +- vector/build.gradle | 79 ++++++++-------- 7 files changed, 167 insertions(+), 109 deletions(-) diff --git a/attachment-viewer/build.gradle b/attachment-viewer/build.gradle index aa0e48bc52..064f497dc7 100644 --- a/attachment-viewer/build.gradle +++ b/attachment-viewer/build.gradle @@ -53,10 +53,10 @@ dependencies { implementation libs.rx.rxKotlin implementation libs.rx.rxAndroid - implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}" + implementation libs.jetbrains.kotlinStdlib implementation libs.androidx.core implementation libs.androidx.appCompat implementation libs.androidx.recyclerview - implementation 'com.google.android.material:material:1.4.0' + implementation libs.google.material } \ No newline at end of file diff --git a/dependencies.gradle b/dependencies.gradle index 440bc2f654..13dc57d7fd 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -5,45 +5,43 @@ ext.versions = [ 'targetSdk' : 30, 'sourceCompat' : JavaVersion.VERSION_11, 'targetCompat' : JavaVersion.VERSION_11, - - // Ref: https://kotlinlang.org/releases.html - 'kotlin' : '1.5.30', - 'kotlinCoroutines' : '1.5.1', - 'dagger' : '2.38.1', - 'timber' : '5.0.1', - 'lifecycle' : '2.2.0', - 'moshi' : '1.12.0', - 'arch' : '2.1.0', - 'markwon' : '4.6.2', - 'arrow' : '0.8.2', - 'rxKotlin' : '2.4.0', - 'rxAndroid' : '2.1.1', - 'retrofit' : '2.9.0', - 'epoxy' : '4.6.2', - 'glide' : '4.12.0', - 'rxBinding' : '3.1.0', - 'bigImageViwer' : '1.8.1', - 'jjwt' : '0.11.2', - 'kluent' : '1.68', - 'androidxTest' : '1.4.0', - 'espresso' : '3.4.0' - - - ] +// Ref: https://kotlinlang.org/releases.html +def gradle = "7.0.2" +def kotlin = "1.5.30" +def kotlinCoroutines = "1.5.1" +def dagger = "2.38.1" +def retrofit = "2.9.0" +def arrow = "0.8.2" +def markwon = "4.6.2" +def moshi = "1.12.0" +def lifecycle = "2.2.0" +def rxBinding = "3.1.0" +def epoxy = "4.6.2" +def glide = "4.12.0" +def bigImageViewer = "1.8.1" +def jjwt = "0.11.2" + +// Testing +def mockk = "1.12.0" +def espresso = "3.4.0" +def androidxTest = "1.4.0" + + ext.libs = [ - gradle : [ - 'gradlePlugin' : "com.android.tools.build:gradle:7.0.2", - 'kotlinPlugin' : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin" + gradle : [ + 'gradlePlugin' : "com.android.tools.build:gradle:$gradle", + 'kotlinPlugin' : "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin" ], - jetbrains : [ - 'kotlinStdlib' : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}", - 'coroutinesCore' : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinCoroutines}", - 'coroutinesAndroid' : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.kotlinCoroutines}", - 'coroutinesRx2' : "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:${versions.kotlinCoroutines}" + jetbrains : [ + 'kotlinStdlibJdk7' : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin", + 'kotlinStdlib' : "org.jetbrains.kotlin:kotlin-stdlib:$kotlin", + 'coroutinesCore' : "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutines", + 'coroutinesAndroid' : "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutines", + 'coroutinesRx2' : "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$kotlinCoroutines" ], - androidx : [ + androidx : [ 'appCompat' : "androidx.appcompat:appcompat:1.3.1", 'core' : "androidx.core:core-ktx:1.6.0", 'recyclerview' : "androidx.recyclerview:recyclerview:1.2.1", @@ -52,20 +50,78 @@ ext.libs = [ 'constraintLayout' : "androidx.constraintlayout:constraintlayout:2.1.0", 'work' : "androidx.work:work-runtime-ktx:2.5.0", 'autoFill' : "androidx.autofill:autofill:1.1.0", - 'junit' : "androidx.test.ext:junit:1.1.3" + 'preferenceKtx' : "androidx.preference:preference-ktx:1.1.1", + 'junit' : "androidx.test.ext:junit:1.1.3", + 'lifecycleExtensions' : "androidx.lifecycle:lifecycle-extensions:$lifecycle", + 'lifecycleJava8' : "androidx.lifecycle:lifecycle-common-java8:$lifecycle", + 'lifecycleLivedata' : "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1", + 'pagingRuntimeKtx' : "androidx.paging:paging-runtime-ktx:2.1.2", + 'coreTesting' : "androidx.arch.core:core-testing:2.1.0", + 'testCore' : "androidx.test:core:$androidxTest", + 'testRunner' : "androidx.test:runner:$androidxTest", + 'testRules' : "androidx.test:rules:$androidxTest", + 'espressoCore' : "androidx.test.espresso:espresso-core:$espresso", + 'espressoContrib' : "androidx.test.espresso:espresso-contrib:$espresso", + 'espressoIntents' : "androidx.test.espresso:espresso-intents:$espresso" ], - dagger : [ - 'dagger' : "com.google.dagger:dagger:${versions.dagger}", - 'daggerCompiler' : "com.google.dagger:dagger-compiler:${versions.dagger}" + google : [ + 'material' : "com.google.android.material:material:1.4.0" ], - rx : [ - 'rxKotlin' : "io.reactivex.rxjava2:rxkotlin:${versions.rxKotlin}", - 'rxAndroid' : "io.reactivex.rxjava2:rxandroid:${versions.rxAndroid}" + dagger : [ + 'dagger' : "com.google.dagger:dagger:$dagger", + 'daggerCompiler' : "com.google.dagger:dagger-compiler:$dagger" ], - jakewharton : [ - 'timber' : "com.jakewharton.timber:timber:${versions.timber}" + squareup : [ + 'moshi' : "com.squareup.moshi:moshi-adapters:$moshi", + 'moshiKotlin' : "com.squareup.moshi:moshi-kotlin-codegen:$moshi", + 'retrofit' : "com.squareup.retrofit2:retrofit:$retrofit", + 'retrofitMoshi' : "com.squareup.retrofit2:converter-moshi:$retrofit" ], - tests : [ + rx : [ + 'rxKotlin' : "io.reactivex.rxjava2:rxkotlin:2.4.0", + 'rxAndroid' : "io.reactivex.rxjava2:rxandroid:2.1.1" + ], + arrow : [ + 'core' : "io.arrow-kt:arrow-core:$arrow", + 'instances' : "io.arrow-kt:arrow-instances-core:$arrow" + ], + markwon : [ + 'core' : "io.noties.markwon:core:$markwon", + 'html' : "io.noties.markwon:html:$markwon" + ], + airbnb : [ + 'epoxy' : "com.airbnb.android:epoxy:$epoxy", + 'epoxyGlide' : "com.airbnb.android:epoxy-glide-preloading:$epoxy", + 'epoxyProcessor' : "com.airbnb.android:epoxy-processor:$epoxy", + 'epoxyPaging' : "com.airbnb.android:epoxy-paging:$epoxy", + 'mvrx' : "com.airbnb.android:mvrx:1.5.1" + ], + mockk : [ + 'mockk' : "io.mockk:mockk:$mockk", + 'mockkAndroid' : "io.mockk:mockk-android:$mockk" + ], + github : [ + 'glide' : "com.github.bumptech.glide:glide:$glide", + 'glideCompiler' : "com.github.bumptech.glide:compiler:$glide", + 'bigImageViewer' : "com.github.piasy:BigImageViewer:$bigImageViewer", + 'glideImageLoader' : "com.github.piasy:GlideImageLoader:$bigImageViewer", + 'progressPieIndicator' : "com.github.piasy:ProgressPieIndicator:$bigImageViewer", + 'glideImageViewFactory' : "com.github.piasy:GlideImageViewFactory:$bigImageViewer" + ], + jakewharton : [ + 'timber' : "com.jakewharton.timber:timber:5.0.1", + 'rxbinding' : "com.jakewharton.rxbinding3:rxbinding:$rxBinding", + 'rxbindingAppcompat' : "com.jakewharton.rxbinding3:rxbinding-appcompat:$rxBinding", + 'rxbindingMaterial' : "com.jakewharton.rxbinding3:rxbinding-material:$rxBinding" + ], + jsonwebtoken: [ + 'jjwtApi' : "io.jsonwebtoken:jjwt-api:$jjwt", + 'jjwtImpl' : "io.jsonwebtoken:jjwt-impl:$jjwt", + 'jjwtOrgjson' : "io.jsonwebtoken:jjwt-orgjson:$jjwt" + ], + tests : [ + 'kluent' : "org.amshove.kluent:kluent-android:1.68", + 'timberJunitRule' : "net.lachlanmckee:timber-junit-rule:1.0.1", 'junit' : "junit:junit:4.13.2" ] ] \ No newline at end of file diff --git a/library/ui-styles/build.gradle b/library/ui-styles/build.gradle index 5985a5d95a..cee58414c7 100644 --- a/library/ui-styles/build.gradle +++ b/library/ui-styles/build.gradle @@ -53,9 +53,9 @@ android { dependencies { implementation libs.androidx.appCompat - implementation 'com.google.android.material:material:1.4.0' + implementation libs.google.material // Pref theme - implementation 'androidx.preference:preference-ktx:1.1.1' + implementation libs.androidx.preferenceKtx // PFLockScreen attrs implementation 'com.github.vector-im:PFLockScreen-Android:1.0.0-beta12' // dialpad dimen diff --git a/matrix-sdk-android-rx/build.gradle b/matrix-sdk-android-rx/build.gradle index 602a9e0506..dbd761cee3 100644 --- a/matrix-sdk-android-rx/build.gradle +++ b/matrix-sdk-android-rx/build.gradle @@ -32,6 +32,7 @@ android { } dependencies { + implementation project(":matrix-sdk-android") implementation libs.androidx.appCompat implementation libs.rx.rxKotlin @@ -39,7 +40,7 @@ dependencies { implementation libs.jetbrains.coroutinesRx2 // Paging - implementation "androidx.paging:paging-runtime-ktx:2.1.2" + implementation libs.androidx.pagingRuntimeKtx // Logging implementation libs.jakewharton.timber diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 0884c9d878..824d51d589 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -101,29 +101,29 @@ static def gitRevisionDate() { dependencies { - implementation libs.jetbrains.kotlinStdlib + implementation libs.jetbrains.kotlinStdlibJdk7 implementation libs.jetbrains.coroutinesCore implementation libs.jetbrains.coroutinesAndroid implementation libs.androidx.appCompat implementation libs.androidx.core - implementation "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}" - implementation "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle}" + implementation libs.androidx.lifecycleExtensions + implementation libs.androidx.lifecycleJava8 // Network - implementation "com.squareup.retrofit2:retrofit:${versions.retrofit}" - implementation "com.squareup.retrofit2:converter-moshi:${versions.retrofit}" + implementation libs.squareup.retrofit + implementation libs.squareup.retrofitMoshi implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.1")) implementation 'com.squareup.okhttp3:okhttp' implementation 'com.squareup.okhttp3:logging-interceptor' implementation 'com.squareup.okhttp3:okhttp-urlconnection' - implementation "com.squareup.moshi:moshi-adapters:${versions.moshi}" - kapt "com.squareup.moshi:moshi-kotlin-codegen:${versions.moshi}" + implementation libs.squareup.moshi + kapt libs.squareup.moshiKotlin - implementation "io.noties.markwon:core:${versions.markwon}" + implementation libs.markwon.core // Image implementation libs.androidx.exifinterface @@ -136,8 +136,8 @@ dependencies { implementation libs.androidx.work // FP - implementation "io.arrow-kt:arrow-core:${versions.arrow}" - implementation "io.arrow-kt:arrow-instances-core:${versions.arrow}" + implementation libs.arrow.core + implementation libs.arrow.instances // olm lib is now hosted by jitpack: https://jitpack.io/#org.matrix.gitlab.matrix-org/olm implementation 'org.matrix.gitlab.matrix-org:olm:3.2.4' @@ -160,24 +160,24 @@ dependencies { testImplementation 'org.robolectric:robolectric:4.6.1' //testImplementation 'org.robolectric:shadows-support-v4:3.0' // Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281 - testImplementation 'io.mockk:mockk:1.12.0' - testImplementation 'org.amshove.kluent:kluent-android:1.68' + testImplementation libs.mockk.mockk + testImplementation libs.tests.kluent implementation libs.jetbrains.coroutinesAndroid // Plant Timber tree for test testImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' kaptAndroidTest libs.dagger.daggerCompiler - androidTestImplementation "androidx.test:core:${versions.androidxTest}" - androidTestImplementation "androidx.test:runner:${versions.androidxTest}" - androidTestImplementation "androidx.test:rules:${versions.androidxTest}" + androidTestImplementation libs.androidx.testCore + androidTestImplementation libs.androidx.testRunner + androidTestImplementation libs.androidx.testRules androidTestImplementation libs.androidx.junit - androidTestImplementation "androidx.test.espresso:espresso-core:${versions.espresso}" - androidTestImplementation 'org.amshove.kluent:kluent-android:1.68' - androidTestImplementation 'io.mockk:mockk-android:1.12.0' - androidTestImplementation "androidx.arch.core:core-testing:${versions.arch}" + androidTestImplementation libs.androidx.espressoCore + androidTestImplementation libs.tests.kluent + androidTestImplementation libs.mockk.mockkAndroid + androidTestImplementation libs.androidx.coreTesting androidTestImplementation libs.jetbrains.coroutinesAndroid // Plant Timber tree for test - androidTestImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' + androidTestImplementation libs.tests.timberJunitRule androidTestUtil 'androidx.test:orchestrator:1.4.0' } diff --git a/multipicker/build.gradle b/multipicker/build.gradle index 8d37ec7ecf..437499df7b 100644 --- a/multipicker/build.gradle +++ b/multipicker/build.gradle @@ -38,7 +38,7 @@ android { } dependencies { - implementation libs.jetbrains.kotlinStdlib + implementation libs.jetbrains.kotlinStdlibJdk7 implementation libs.androidx.appCompat implementation libs.androidx.fragmentKtx implementation libs.androidx.exifinterface diff --git a/vector/build.gradle b/vector/build.gradle index 37995d9e8a..afc6ac6a25 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -324,7 +324,7 @@ dependencies { implementation project(":library:ui-styles") implementation 'androidx.multidex:multidex:2.0.1' - implementation libs.jetbrains.kotlinStdlib + implementation libs.jetbrains.kotlinStdlibJdk7 implementation libs.jetbrains.coroutinesCore implementation libs.jetbrains.coroutinesAndroid @@ -340,10 +340,11 @@ dependencies { implementation "org.threeten:threetenbp:1.4.0:no-tzdb" implementation "com.gabrielittner.threetenbp:lazythreetenbp:0.9.0" - implementation "com.squareup.moshi:moshi-adapters:${versions.moshi}" - implementation "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1" - kapt "com.squareup.moshi:moshi-kotlin-codegen:${versions.moshi}" + implementation libs.squareup.moshi + kapt libs.squareup.moshiKotlin + implementation libs.androidx.lifecycleExtensions + implementation libs.androidx.lifecycleLivedata + // Log implementation libs.jakewharton.timber @@ -359,34 +360,34 @@ dependencies { implementation libs.rx.rxAndroid implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1' // RXBinding - implementation "com.jakewharton.rxbinding3:rxbinding:${versions.rxBinding}" - implementation "com.jakewharton.rxbinding3:rxbinding-appcompat:${versions.rxBinding}" - implementation "com.jakewharton.rxbinding3:rxbinding-material:${versions.rxBinding}" + implementation libs.jakewharton.rxbinding + implementation libs.jakewharton.rxbindingAppcompat + implementation libs.jakewharton.rxbindingMaterial - implementation("com.airbnb.android:epoxy:${versions.epoxy}") - implementation "com.airbnb.android:epoxy-glide-preloading:${versions.epoxy}" - kapt "com.airbnb.android:epoxy-processor:${versions.epoxy}" - implementation "com.airbnb.android:epoxy-paging:${versions.epoxy}" - implementation 'com.airbnb.android:mvrx:1.5.1' + implementation libs.airbnb.epoxy + implementation libs.airbnb.epoxyGlide + kapt libs.airbnb.epoxyProcessor + implementation libs.airbnb.epoxyPaging + implementation libs.airbnb.mvrx // Work implementation libs.androidx.work // Paging - implementation "androidx.paging:paging-runtime-ktx:2.1.2" + implementation libs.androidx.pagingRuntimeKtx // Functional Programming - implementation "io.arrow-kt:arrow-core:${versions.arrow}" + implementation libs.arrow.core // Pref - implementation 'androidx.preference:preference-ktx:1.1.1' + implementation libs.androidx.preferenceKtx // UI implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1' - implementation 'com.google.android.material:material:1.4.0' + implementation libs.google.material implementation 'me.gujun.android:span:1.7' - implementation "io.noties.markwon:core:${versions.markwon}" - implementation "io.noties.markwon:html:${versions.markwon}" + implementation libs.markwon.core + implementation libs.markwon.html implementation 'com.googlecode.htmlcompressor:htmlcompressor:1.5.2' implementation 'me.saket:better-link-movement-method:2.2.0' implementation 'com.google.android:flexbox:2.0.1' @@ -414,16 +415,16 @@ dependencies { implementation 'com.squareup:seismic:1.0.2' // Image Loading - implementation "com.github.piasy:BigImageViewer:${versions.bigImageViwer}" - implementation "com.github.piasy:GlideImageLoader:${versions.bigImageViwer}" - implementation "com.github.piasy:ProgressPieIndicator:${versions.bigImageViwer}" - implementation "com.github.piasy:GlideImageViewFactory:${versions.bigImageViwer}" + implementation libs.github.bigImageViewer + implementation libs.github.glideImageLoader + implementation libs.github.progressPieIndicator + implementation libs.github.glideImageViewFactory // implementation 'com.github.MikeOrtiz:TouchImageView:3.0.2' implementation 'com.github.chrisbanes:PhotoView:2.3.0' - implementation "com.github.bumptech.glide:glide:${versions.glide}" - kapt "com.github.bumptech.glide:compiler:${versions.glide}" + implementation libs.github.glide + kapt libs.github.glideCompiler implementation 'com.danikula:videocache:2.7.1' implementation 'com.github.yalantis:ucrop:2.2.7' @@ -475,9 +476,9 @@ dependencies { implementation 'im.dlg:android-dialer:1.2.5' // JWT - api "io.jsonwebtoken:jjwt-api:${versions.jjwt}" - runtimeOnly "io.jsonwebtoken:jjwt-impl:${versions.jjwt}" - runtimeOnly("io.jsonwebtoken:jjwt-orgjson:${versions.jjwt}") { + api libs.jsonwebtoken.jjwtApi + runtimeOnly libs.jsonwebtoken.jjwtImpl + runtimeOnly(libs.jsonwebtoken.jjwtOrgjson) { exclude group: 'org.json', module: 'json' //provided by Android natively } implementation 'commons-codec:commons-codec:1.15' @@ -485,24 +486,24 @@ dependencies { // TESTS testImplementation libs.tests.junit - testImplementation "org.amshove.kluent:kluent-android:${versions.kluent}" + testImplementation libs.tests.kluent // Plant Timber tree for test - testImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' + testImplementation libs.tests.timberJunitRule // Activate when you want to check for leaks, from time to time. //debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.3' - androidTestImplementation "androidx.test:core:${versions.androidxTest}" - androidTestImplementation "androidx.test:runner:${versions.androidxTest}" - androidTestImplementation "androidx.test:rules:${versions.androidxTest}" + androidTestImplementation libs.androidx.testCore + androidTestImplementation libs.androidx.testRunner + androidTestImplementation libs.androidx.testRules androidTestImplementation libs.androidx.junit - androidTestImplementation "androidx.test.espresso:espresso-core:${versions.espresso}" - androidTestImplementation "androidx.test.espresso:espresso-contrib:${versions.espresso}" - androidTestImplementation "androidx.test.espresso:espresso-intents:${versions.espresso}" - androidTestImplementation "org.amshove.kluent:kluent-android:${versions.kluent}" - androidTestImplementation "androidx.arch.core:core-testing:${versions.arch}" + androidTestImplementation libs.androidx.espressoCore + androidTestImplementation libs.androidx.espressoContrib + androidTestImplementation libs.androidx.espressoIntents + androidTestImplementation libs.tests.kluent + androidTestImplementation libs.androidx.coreTesting // Plant Timber tree for test - androidTestImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' + androidTestImplementation libs.tests.timberJunitRule // "The one who serves a great Espresso" androidTestImplementation('com.adevinta.android:barista:4.1.0') { exclude group: 'org.jetbrains.kotlin'