From 3598dbdedecab1f20eaf22e267bccb65a40f872c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Nov 2023 15:52:28 +0100 Subject: [PATCH 1/9] Use gradle catalog. --- build.gradle.kts | 4 ++-- gradle/libs.versions.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b2e4ac3c0f..a2dbec823c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,8 +5,8 @@ import org.jetbrains.kotlin.cli.common.toBooleanLenient buildscript { dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20") - classpath("com.google.gms:google-services:4.4.0") + classpath(libs.kotlin.gradle.plugin) + classpath(libs.gms.google.services) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b9b775b1a3..0eab4ed226 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -68,6 +68,7 @@ android_gradle_plugin = { module = "com.android.tools.build:gradle", version.ref # https://developer.android.com/studio/write/java8-support#library-desugaring-versions android_desugar = "com.android.tools:desugar_jdk_libs:2.0.4" kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +gms_google_services = "com.google.gms:google-services:4.4.0" # https://firebase.google.com/docs/android/setup#available-libraries google_firebase_bom = "com.google.firebase:firebase-bom:32.5.0" From f63bd75def5dda865ce281550cd136a22b96684f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Nov 2023 15:52:53 +0100 Subject: [PATCH 2/9] Upgrade lint to 8.3.0-alpha12 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index cf609500c2..0ece8f4e8c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -49,7 +49,7 @@ signing.element.nightly.keyPassword=Secret # Customise the Lint version to use a more recent version than the one bundled with AGP # https://googlesamples.github.io/android-custom-lint-rules/usage/newer-lint.md.html -android.experimental.lint.version=8.3.0-alpha11 +android.experimental.lint.version=8.3.0-alpha12 # Enable test fixture for all modules by default android.experimental.enableTestFixtures=true From 607703217fec70f3afd19c3106f2ca455bfa813f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Nov 2023 16:23:23 +0100 Subject: [PATCH 3/9] Gradle catalog: do not use version.ref if there is only one module which use it. --- gradle/libs.versions.toml | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0eab4ed226..1833873838 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,19 +6,15 @@ android_gradle_plugin = "8.1.3" kotlin = "1.9.20" ksp = "1.9.20-1.0.14" -molecule = "1.3.0" # AndroidX core = "1.12.0" datastore = "1.0.0" constraintlayout = "2.1.4" constraintlayout_compose = "1.0.1" -recyclerview = "1.3.2" lifecycle = "2.7.0-beta01" activity = "1.8.0" -startup = "1.1.1" media3 = "1.1.1" -browser = "1.6.0" # Compose compose_bom = "2023.10.01" @@ -38,13 +34,8 @@ coil = "2.5.0" datetime = "0.4.1" serialization_json = "1.6.0" showkase = "1.0.2" -jsoup = "1.16.2" appyx = "1.4.0" -dependencycheck = "8.4.2" -dependencyanalysis = "1.25.0" -stem = "2.3.0" sqldelight = "2.0.0" -telephoto = "0.6.2" wysiwyg = "2.16.0" # DI @@ -55,12 +46,9 @@ anvil = "2.4.8-1-8" autoservice = "1.1.1" # quality -detekt = "1.23.3" -dependencygraph = "0.12" junit = "4.13.2" androidx-test-ext-junit = "1.1.5" espresso-core = "3.5.1" -appcompat = "1.6.1" [libraries] # Project @@ -82,8 +70,8 @@ androidx_exifinterface = "androidx.exifinterface:exifinterface:1.3.6" androidx_constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } androidx_constraintlayout_compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "constraintlayout_compose" } -androidx_recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" } -androidx_browser = { module = "androidx.browser:browser", version.ref = "browser" } +androidx_recyclerview = "androidx.recyclerview:recyclerview:1.3.2" +androidx_browser = "androidx.browser:browser:1.6.0" androidx_lifecycle_runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" } androidx_lifecycle_process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle" } androidx_splash = "androidx.core:core-splashscreen:1.0.1" @@ -94,11 +82,11 @@ androidx_biometric = "androidx.biometric:biometric-ktx:1.2.0-alpha05" androidx_activity_activity = { module = "androidx.activity:activity", version.ref = "activity" } androidx_activity_compose = { module = "androidx.activity:activity-compose", version.ref = "activity" } -androidx_startup = { module = "androidx.startup:startup-runtime", version.ref = "startup" } +androidx_startup = "androidx.startup:startup-runtime:1.1.1" androidx_preference = "androidx.preference:preference:1.2.1" androidx_webkit = "androidx.webkit:webkit:1.8.0" -androidx_compose_bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose_bom" } +androidx_compose_bom = { module = "androidx.compose:compose-bom", version.ref = "compose_bom" } androidx_compose_material3 = "androidx.compose.material3:material3:1.2.0-alpha10" # Coroutines @@ -146,9 +134,9 @@ datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "d serialization_json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization_json" } showkase = { module = "com.airbnb.android:showkase", version.ref = "showkase" } showkase_processor = { module = "com.airbnb.android:showkase-processor", version.ref = "showkase" } -jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" } +jsoup = "org.jsoup:jsoup:1.16.2" appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" } -molecule-runtime = { module = "app.cash.molecule:molecule-runtime", version.ref = "molecule" } +molecule-runtime = "app.cash.molecule:molecule-runtime:1.3.0" timber = "com.jakewharton.timber:timber:5.0.1" matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.1.67" matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" } @@ -161,7 +149,7 @@ sqlite = "androidx.sqlite:sqlite-ktx:2.4.0" unifiedpush = "com.github.UnifiedPush:android-connector:2.1.1" otaliastudios_transcoder = "com.otaliastudios:transcoder:0.10.5" vanniktech_blurhash = "com.vanniktech:blurhash:0.1.0" -telephoto_zoomableimage = { module = "me.saket.telephoto:zoomable-image-coil", version.ref = "telephoto" } +telephoto_zoomableimage = "me.saket.telephoto:zoomable-image-coil:0.6.2" statemachine = "com.freeletics.flowredux:compose:1.2.0" maplibre = "org.maplibre.gl:android-sdk:10.2.0" maplibre_ktx = "org.maplibre.gl:android-sdk-ktx-v7:2.0.2" @@ -195,7 +183,7 @@ android_composeCompiler = { module = "androidx.compose.compiler:compiler", versi junit = { group = "junit", name = "junit", version.ref = "junit" } androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" } espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" } -appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +appcompat = "androidx.appcompat:appcompat:1.6.1" [bundles] @@ -208,11 +196,11 @@ kotlin_serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } anvil = { id = "com.squareup.anvil", version.ref = "anvil" } -detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } +detekt = "io.gitlab.arturbosch.detekt:1.23.3" ktlint = "org.jlleitschuh.gradle.ktlint:11.6.1" -dependencygraph = { id = "com.savvasdalkitsis.module-dependency-graph", version.ref = "dependencygraph" } -dependencycheck = { id = "org.owasp.dependencycheck", version.ref = "dependencycheck" } -dependencyanalysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyanalysis" } +dependencygraph = "com.savvasdalkitsis.module-dependency-graph:0.12" +dependencycheck = "org.owasp.dependencycheck:8.4.2" +dependencyanalysis = "com.autonomousapps.dependency-analysis:1.25.0" paparazzi = "app.cash.paparazzi:1.3.1" kover = "org.jetbrains.kotlinx.kover:0.6.1" sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } From 765ede00937b988f7a21090d6efdea2242860609 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Nov 2023 16:25:58 +0100 Subject: [PATCH 4/9] Replace hard-coded value by value from gradle datalog --- features/login/impl/build.gradle.kts | 2 +- libraries/matrix/api/build.gradle.kts | 2 +- libraries/matrix/impl/build.gradle.kts | 2 +- libraries/push/impl/build.gradle.kts | 2 +- libraries/pushproviders/unifiedpush/build.gradle.kts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/login/impl/build.gradle.kts b/features/login/impl/build.gradle.kts index b071e6509f..3968ef8ab2 100644 --- a/features/login/impl/build.gradle.kts +++ b/features/login/impl/build.gradle.kts @@ -19,7 +19,7 @@ plugins { alias(libs.plugins.anvil) alias(libs.plugins.ksp) id("kotlin-parcelize") - kotlin("plugin.serialization") version "1.9.20" + kotlin("plugin.serialization") version libs.versions.kotlin } android { diff --git a/libraries/matrix/api/build.gradle.kts b/libraries/matrix/api/build.gradle.kts index 770f6459a0..f1fec9b60b 100644 --- a/libraries/matrix/api/build.gradle.kts +++ b/libraries/matrix/api/build.gradle.kts @@ -18,7 +18,7 @@ plugins { id("io.element.android-compose-library") id("kotlin-parcelize") alias(libs.plugins.anvil) - kotlin("plugin.serialization") version "1.9.20" + kotlin("plugin.serialization") version libs.versions.kotlin } android { diff --git a/libraries/matrix/impl/build.gradle.kts b/libraries/matrix/impl/build.gradle.kts index 35c68001f3..9dba63362d 100644 --- a/libraries/matrix/impl/build.gradle.kts +++ b/libraries/matrix/impl/build.gradle.kts @@ -17,7 +17,7 @@ plugins { id("io.element.android-library") alias(libs.plugins.anvil) - kotlin("plugin.serialization") version "1.9.20" + kotlin("plugin.serialization") version libs.versions.kotlin } android { diff --git a/libraries/push/impl/build.gradle.kts b/libraries/push/impl/build.gradle.kts index 6c7844bd96..65e4c0939f 100644 --- a/libraries/push/impl/build.gradle.kts +++ b/libraries/push/impl/build.gradle.kts @@ -16,7 +16,7 @@ plugins { id("io.element.android-library") alias(libs.plugins.anvil) - kotlin("plugin.serialization") version "1.9.20" + kotlin("plugin.serialization") version libs.versions.kotlin } android { diff --git a/libraries/pushproviders/unifiedpush/build.gradle.kts b/libraries/pushproviders/unifiedpush/build.gradle.kts index 41bffc5461..5b90f53a08 100644 --- a/libraries/pushproviders/unifiedpush/build.gradle.kts +++ b/libraries/pushproviders/unifiedpush/build.gradle.kts @@ -16,7 +16,7 @@ plugins { id("io.element.android-library") alias(libs.plugins.anvil) - kotlin("plugin.serialization") version "1.9.20" + kotlin("plugin.serialization") version libs.versions.kotlin } android { From 33fe608459b462ea2068528430ab409e5bbba14c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Nov 2023 16:39:05 +0100 Subject: [PATCH 5/9] Move appdistribution declarations to Gradle catalog --- app/build.gradle.kts | 2 +- gradle/libs.versions.toml | 3 +++ plugins/build.gradle.kts | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c8e11927d1..c4ff2bdaf9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -27,7 +27,7 @@ plugins { alias(libs.plugins.anvil) alias(libs.plugins.ksp) alias(libs.plugins.kapt) - id("com.google.firebase.appdistribution") version "4.0.1" + alias(libs.plugins.firebaseAppDistribution) id("org.jetbrains.kotlinx.knit") version "0.4.0" id("kotlin-parcelize") // To be able to update the firebase.xml files, uncomment and build the project diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1833873838..906c2f3b8b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,6 +6,7 @@ android_gradle_plugin = "8.1.3" kotlin = "1.9.20" ksp = "1.9.20-1.0.14" +firebaseAppDistribution = "4.0.1" # AndroidX core = "1.12.0" @@ -59,6 +60,7 @@ kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", v gms_google_services = "com.google.gms:google-services:4.4.0" # https://firebase.google.com/docs/android/setup#available-libraries google_firebase_bom = "com.google.firebase:firebase-bom:32.5.0" +firebase_appdistribution_gradle = { module = "com.google.firebase:firebase-appdistribution-gradle", version.ref = "firebaseAppDistribution" } # AndroidX androidx_core = { module = "androidx.core:core", version.ref = "core" } @@ -204,6 +206,7 @@ dependencyanalysis = "com.autonomousapps.dependency-analysis:1.25.0" paparazzi = "app.cash.paparazzi:1.3.1" kover = "org.jetbrains.kotlinx.kover:0.6.1" sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } +firebaseAppDistribution = { id = "com.google.firebase.appdistribution", version.ref = "firebaseAppDistribution" } # Version '4.3.1.3277' introduced some regressions in CI time (more than 2x slower), so make sure # this is no longer the case before upgrading. diff --git a/plugins/build.gradle.kts b/plugins/build.gradle.kts index 9986d490fa..c820902905 100644 --- a/plugins/build.gradle.kts +++ b/plugins/build.gradle.kts @@ -27,7 +27,6 @@ dependencies { implementation(libs.android.gradle.plugin) implementation(libs.kotlin.gradle.plugin) implementation(platform(libs.google.firebase.bom)) - // FIXME: using the bom ^, it should not be necessary to provide the version v... - implementation("com.google.firebase:firebase-appdistribution-gradle:4.0.1") + implementation(libs.firebase.appdistribution.gradle) implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) } From a9995886c037972bf3f2f46b517d7651cb818d08 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Nov 2023 16:56:04 +0100 Subject: [PATCH 6/9] Move remaining hard-coded dependency to Gradle catalog. We had 2 different version of material3 library. --- anvilcodegen/build.gradle.kts | 2 +- features/rageshake/impl/build.gradle.kts | 2 +- gradle/libs.versions.toml | 10 ++++++++++ libraries/matrix/impl/build.gradle.kts | 2 +- .../pushproviders/unifiedpush/build.gradle.kts | 2 +- .../kotlin/extension/DependencyHandleScope.kt | 16 ++++++++-------- tests/konsist/build.gradle.kts | 2 +- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/anvilcodegen/build.gradle.kts b/anvilcodegen/build.gradle.kts index 57758f8909..62a8b9d878 100644 --- a/anvilcodegen/build.gradle.kts +++ b/anvilcodegen/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { implementation(projects.anvilannotations) api(libs.anvil.compiler.api) implementation(libs.anvil.compiler.utils) - implementation("com.squareup:kotlinpoet:1.14.2") + implementation(libs.kotlinpoet) implementation(libs.dagger) compileOnly(libs.google.autoservice.annotations) kapt(libs.google.autoservice) diff --git a/features/rageshake/impl/build.gradle.kts b/features/rageshake/impl/build.gradle.kts index eced5c78b8..f119cbf6c8 100644 --- a/features/rageshake/impl/build.gradle.kts +++ b/features/rageshake/impl/build.gradle.kts @@ -44,7 +44,7 @@ dependencies { api(projects.features.rageshake.api) implementation(libs.androidx.datastore.preferences) implementation(platform(libs.network.okhttp.bom)) - implementation("com.squareup.okhttp3:okhttp") + implementation(libs.network.okhttp.okhttp) implementation(libs.coil) implementation(libs.coil.compose) ksp(libs.showkase.processor) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 906c2f3b8b..f9baaa81ef 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -90,6 +90,12 @@ androidx_webkit = "androidx.webkit:webkit:1.8.0" androidx_compose_bom = { module = "androidx.compose:compose-bom", version.ref = "compose_bom" } androidx_compose_material3 = "androidx.compose.material3:material3:1.2.0-alpha10" +androidx_compose_ui = { module = "androidx.compose.ui:ui" } +androidx_compose_ui_tooling = { module = "androidx.compose.ui:ui-tooling" } +androidx_compose_ui_tooling_preview = { module = "androidx.compose.ui:ui-tooling-preview" } +androidx_compose_ui_test_manifest = { module = "androidx.compose.ui:ui-test-manifest" } +androidx_compose_material = { module = "androidx.compose.material:material" } +androidx_compose_material_icons = { module = "androidx.compose.material:material-icons-extended" } # Coroutines coroutines_core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } @@ -105,6 +111,7 @@ squareup_seismic = "com.squareup:seismic:1.0.3" # network network_okhttp_bom = "com.squareup.okhttp3:okhttp-bom:4.12.0" network_okhttp_logging = { module = "com.squareup.okhttp3:logging-interceptor" } +network_okhttp_okhttp = { module = "com.squareup.okhttp3:okhttp" } network_okhttp = { module = "com.squareup.okhttp3:okhttp" } network_retrofit = "com.squareup.retrofit2:retrofit:2.9.0" network_retrofit_converter_serialization = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0" @@ -134,6 +141,7 @@ coil_compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" } coil_gif = { module = "io.coil-kt:coil-gif", version.ref = "coil" } datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" } serialization_json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization_json" } +kotlinx_collections_immutable = "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5" showkase = { module = "com.airbnb.android:showkase", version.ref = "showkase" } showkase_processor = { module = "com.airbnb.android:showkase-processor", version.ref = "showkase" } jsoup = "org.jsoup:jsoup:1.16.2" @@ -157,6 +165,8 @@ maplibre = "org.maplibre.gl:android-sdk:10.2.0" maplibre_ktx = "org.maplibre.gl:android-sdk-ktx-v7:2.0.2" maplibre_annotation = "org.maplibre.gl:android-plugin-annotation-v9:2.0.2" opusencoder = "io.element.android:opusencoder:1.1.0" +kotlinpoet = "com.squareup:kotlinpoet:1.14.2" +jna = "net.java.dev.jna:jna:5.13.0@aar" # Analytics posthog = "com.posthog.android:posthog:2.0.3" diff --git a/libraries/matrix/impl/build.gradle.kts b/libraries/matrix/impl/build.gradle.kts index 9dba63362d..026b06f765 100644 --- a/libraries/matrix/impl/build.gradle.kts +++ b/libraries/matrix/impl/build.gradle.kts @@ -44,7 +44,7 @@ dependencies { api(projects.libraries.matrix.api) implementation(libs.dagger) implementation(projects.libraries.core) - implementation("net.java.dev.jna:jna:5.13.0@aar") + implementation(libs.jna) implementation(libs.androidx.datastore.preferences) implementation(libs.serialization.json) diff --git a/libraries/pushproviders/unifiedpush/build.gradle.kts b/libraries/pushproviders/unifiedpush/build.gradle.kts index 5b90f53a08..dfc999c897 100644 --- a/libraries/pushproviders/unifiedpush/build.gradle.kts +++ b/libraries/pushproviders/unifiedpush/build.gradle.kts @@ -41,7 +41,7 @@ dependencies { implementation(projects.libraries.network) implementation(platform(libs.network.okhttp.bom)) - implementation("com.squareup.okhttp3:okhttp") + implementation(libs.network.okhttp.okhttp) implementation(libs.network.retrofit) implementation(libs.serialization.json) diff --git a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt index c6786ef8b3..f6ec8b7cf1 100644 --- a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt +++ b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt @@ -42,16 +42,16 @@ fun DependencyHandlerScope.composeDependencies(libs: LibrariesForLibs) { val composeBom = platform(libs.androidx.compose.bom) implementation(composeBom) androidTestImplementation(composeBom) - implementation("androidx.compose.ui:ui") - implementation("androidx.compose.material:material") - implementation("androidx.compose.material3:material3") - implementation("androidx.compose.material:material-icons-extended") - implementation("androidx.compose.ui:ui-tooling-preview") + implementation(libs.androidx.compose.ui) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.material.icons) + implementation(libs.androidx.compose.ui.tooling.preview) implementation(libs.androidx.activity.compose) - debugImplementation("androidx.compose.ui:ui-tooling") - debugImplementation("androidx.compose.ui:ui-test-manifest") + debugImplementation(libs.androidx.compose.ui.tooling) + debugImplementation(libs.androidx.compose.ui.test.manifest) implementation(libs.showkase) - implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5") + implementation(libs.kotlinx.collections.immutable) } private fun DependencyHandlerScope.addImplementationProjects( diff --git a/tests/konsist/build.gradle.kts b/tests/konsist/build.gradle.kts index 6658c0c5e0..1ce4e9f232 100644 --- a/tests/konsist/build.gradle.kts +++ b/tests/konsist/build.gradle.kts @@ -25,7 +25,7 @@ android { dependencies { val composeBom = platform(libs.androidx.compose.bom) testImplementation(composeBom) - testImplementation("androidx.compose.ui:ui-tooling-preview") + testImplementation(libs.androidx.compose.ui.tooling.preview) testImplementation(libs.test.junit) testImplementation(libs.test.konsist) testImplementation(libs.test.truth) From 67f78df77c02a8aa105e777baf189e0253acf301 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Nov 2023 16:56:35 +0100 Subject: [PATCH 7/9] Short notation --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f9baaa81ef..4bf386ee87 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -65,7 +65,7 @@ firebase_appdistribution_gradle = { module = "com.google.firebase:firebase-appdi # AndroidX androidx_core = { module = "androidx.core:core", version.ref = "core" } androidx_corektx = { module = "androidx.core:core-ktx", version.ref = "core" } -androidx_annotationjvm = { module = "androidx.annotation:annotation-jvm", version = "1.7.0" } +androidx_annotationjvm = "androidx.annotation:annotation-jvm:1.7.0" androidx_datastore_preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" } androidx_datastore_datastore = { module = "androidx.datastore:datastore", version.ref = "datastore" } androidx_exifinterface = "androidx.exifinterface:exifinterface:1.3.6" From 616dfb443ce6aca34cc41bfa8d107dcf7c71f270 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 10 Nov 2023 16:59:36 +0100 Subject: [PATCH 8/9] Remove unused entries from the catalog. --- gradle/libs.versions.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4bf386ee87..225c793e95 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -122,13 +122,9 @@ test_corektx = { module = "androidx.test:core-ktx", version.ref = "test_core" } test_arch_core = "androidx.arch.core:core-testing:2.2.0" test_junit = "junit:junit:4.13.2" test_runner = "androidx.test:runner:1.5.2" -test_uiautomator = "androidx.test.uiautomator:uiautomator:2.2.0" test_junitext = "androidx.test.ext:junit:1.1.5" test_mockk = "io.mockk:mockk:1.13.8" -test_barista = "com.adevinta.android:barista:4.3.0" test_konsist = "com.lemonappdev:konsist:0.13.0" -test_hamcrest = "org.hamcrest:hamcrest:2.2" -test_orchestrator = "androidx.test:orchestrator:1.4.2" test_turbine = "app.cash.turbine:turbine:1.0.0" test_truth = "com.google.truth:truth:1.1.5" test_parameter_injector = "com.google.testparameterinjector:test-parameter-injector:1.14" From 79806852ca58839aa5c27de1a066db046d2b02f3 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 13 Nov 2023 09:58:00 +0100 Subject: [PATCH 9/9] Move Knit to Gradle catalog and use alias(libs.plugins.kotlin.serialization). Fix issue with JNA --- app/build.gradle.kts | 2 +- features/login/impl/build.gradle.kts | 2 +- gradle/libs.versions.toml | 2 +- libraries/matrix/api/build.gradle.kts | 2 +- libraries/matrix/impl/build.gradle.kts | 4 ++-- libraries/push/impl/build.gradle.kts | 2 +- libraries/pushproviders/unifiedpush/build.gradle.kts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c4ff2bdaf9..69a1877455 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -28,7 +28,7 @@ plugins { alias(libs.plugins.ksp) alias(libs.plugins.kapt) alias(libs.plugins.firebaseAppDistribution) - id("org.jetbrains.kotlinx.knit") version "0.4.0" + alias(libs.plugins.knit) id("kotlin-parcelize") // To be able to update the firebase.xml files, uncomment and build the project // id("com.google.gms.google-services") diff --git a/features/login/impl/build.gradle.kts b/features/login/impl/build.gradle.kts index 3968ef8ab2..227c512043 100644 --- a/features/login/impl/build.gradle.kts +++ b/features/login/impl/build.gradle.kts @@ -19,7 +19,7 @@ plugins { alias(libs.plugins.anvil) alias(libs.plugins.ksp) id("kotlin-parcelize") - kotlin("plugin.serialization") version libs.versions.kotlin + alias(libs.plugins.kotlin.serialization) } android { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 225c793e95..3f9ede419f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -162,7 +162,6 @@ maplibre_ktx = "org.maplibre.gl:android-sdk-ktx-v7:2.0.2" maplibre_annotation = "org.maplibre.gl:android-plugin-annotation-v9:2.0.2" opusencoder = "io.element.android:opusencoder:1.1.0" kotlinpoet = "com.squareup:kotlinpoet:1.14.2" -jna = "net.java.dev.jna:jna:5.13.0@aar" # Analytics posthog = "com.posthog.android:posthog:2.0.3" @@ -213,6 +212,7 @@ paparazzi = "app.cash.paparazzi:1.3.1" kover = "org.jetbrains.kotlinx.kover:0.6.1" sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } firebaseAppDistribution = { id = "com.google.firebase.appdistribution", version.ref = "firebaseAppDistribution" } +knit = { id = "org.jetbrains.kotlinx.knit", version = "0.4.0" } # Version '4.3.1.3277' introduced some regressions in CI time (more than 2x slower), so make sure # this is no longer the case before upgrading. diff --git a/libraries/matrix/api/build.gradle.kts b/libraries/matrix/api/build.gradle.kts index f1fec9b60b..f8a600df1e 100644 --- a/libraries/matrix/api/build.gradle.kts +++ b/libraries/matrix/api/build.gradle.kts @@ -18,7 +18,7 @@ plugins { id("io.element.android-compose-library") id("kotlin-parcelize") alias(libs.plugins.anvil) - kotlin("plugin.serialization") version libs.versions.kotlin + alias(libs.plugins.kotlin.serialization) } android { diff --git a/libraries/matrix/impl/build.gradle.kts b/libraries/matrix/impl/build.gradle.kts index 026b06f765..81b5f70a11 100644 --- a/libraries/matrix/impl/build.gradle.kts +++ b/libraries/matrix/impl/build.gradle.kts @@ -17,7 +17,7 @@ plugins { id("io.element.android-library") alias(libs.plugins.anvil) - kotlin("plugin.serialization") version libs.versions.kotlin + alias(libs.plugins.kotlin.serialization) } android { @@ -44,7 +44,7 @@ dependencies { api(projects.libraries.matrix.api) implementation(libs.dagger) implementation(projects.libraries.core) - implementation(libs.jna) + implementation("net.java.dev.jna:jna:5.13.0@aar") implementation(libs.androidx.datastore.preferences) implementation(libs.serialization.json) diff --git a/libraries/push/impl/build.gradle.kts b/libraries/push/impl/build.gradle.kts index 65e4c0939f..05f552dd9a 100644 --- a/libraries/push/impl/build.gradle.kts +++ b/libraries/push/impl/build.gradle.kts @@ -16,7 +16,7 @@ plugins { id("io.element.android-library") alias(libs.plugins.anvil) - kotlin("plugin.serialization") version libs.versions.kotlin + alias(libs.plugins.kotlin.serialization) } android { diff --git a/libraries/pushproviders/unifiedpush/build.gradle.kts b/libraries/pushproviders/unifiedpush/build.gradle.kts index dfc999c897..733309e00d 100644 --- a/libraries/pushproviders/unifiedpush/build.gradle.kts +++ b/libraries/pushproviders/unifiedpush/build.gradle.kts @@ -16,7 +16,7 @@ plugins { id("io.element.android-library") alias(libs.plugins.anvil) - kotlin("plugin.serialization") version libs.versions.kotlin + alias(libs.plugins.kotlin.serialization) } android {