From 0c939a2929e590d8a891237240ffc9f89f0c7405 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 25 Oct 2022 18:28:45 +0530 Subject: [PATCH] refactor(deps): switch to Compose BOM --- app/build.gradle.kts | 3 ++- gradle/libs.versions.toml | 28 ++++++++++++++-------------- settings.gradle.kts | 1 + ui-compose/build.gradle.kts | 3 ++- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9baec021..8d528540 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -32,7 +32,7 @@ android { compose = true composeOptions { useLiveLiterals = false - kotlinCompilerExtensionVersion = libs.compose.compiler.get().versionConstraint.requiredVersion + kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() } } @@ -51,6 +51,7 @@ android { } dependencies { + implementation(platform(libs.compose.bom)) kapt(libs.dagger.hilt.compiler) implementation(libs.androidx.annotation) coreLibraryDesugaring(libs.android.desugarJdkLibs) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7b097538..85efa1cb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,8 +3,8 @@ agp = "7.3.1" androidxActivity = "1.7.0-alpha02" beagle = "2.9.0" bouncycastle = "1.72" -composeFoundation = "1.3.0" -composeUi = "1.3.0" +# @keep used for kotlinCompilerExtensionVersion +composeCompiler = "1.3.2" coroutines = "1.6.4" flowbinding = "1.2.0" hilt = "2.44" @@ -50,19 +50,19 @@ build-sentry = "io.sentry.android.gradle:io.sentry.android.gradle.gradle.plugin: build-spotless = "com.diffplug.spotless:spotless-plugin-gradle:6.11.0" build-vcu = "nl.littlerobots.version-catalog-update:nl.littlerobots.version-catalog-update.gradle.plugin:0.7.0" build-versions = "com.github.ben-manes:gradle-versions-plugin:0.43.0" -compose-animation = "androidx.compose.animation:animation:1.3.0" -compose-compiler = "androidx.compose.compiler:compiler:1.3.2" -compose-foundation-core = { module = "androidx.compose.foundation:foundation", version.ref = "composeFoundation" } -compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "composeFoundation" } +compose-animation = { module = "androidx.compose.animation:animation" } +compose-bom = "androidx.compose:compose-bom:2022.10.00" +compose-foundation-core = { module = "androidx.compose.foundation:foundation" } +compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" } compose-hilt = "androidx.hilt:hilt-navigation-compose:1.0.0" -compose-material = "androidx.compose.material:material:1.3.0" -compose-material3 = "androidx.compose.material3:material3:1.0.0" -compose-runtime = "androidx.compose.runtime:runtime:1.3.0" -compose-ui-core = { module = "androidx.compose.ui:ui", version.ref = "composeUi" } -compose-ui-test = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "composeUi" } -compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "composeUi" } -compose-ui-util = { module = "androidx.compose.ui:ui-util", version.ref = "composeUi" } -compose-ui-viewbinding = { module = "androidx.compose.ui:ui-viewbinding", version.ref = "composeUi" } +compose-material = { module = "androidx.compose.material:material" } +compose-material3 = { module = "androidx.compose.material3:material3" } +compose-runtime = { module = "androidx.compose.runtime:runtime" } +compose-ui-core = { module = "androidx.compose.ui:ui" } +compose-ui-test = { module = "androidx.compose.ui:ui-test-junit4" } +compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +compose-ui-util = { module = "androidx.compose.ui:ui-util" } +compose-ui-viewbinding = { module = "androidx.compose.ui:ui-viewbinding" } dagger-hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } dagger-hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" } dagger-hilt-core = { module = "com.google.dagger:hilt-core", version.ref = "hilt" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 6e6ce14f..907f99ed 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -133,6 +133,7 @@ dependencyResolutionManagement { includeGroup("com.android.tools.layoutlib") includeGroup("com.android.tools.lint") includeGroup("com.google.android.gms") + includeModule("androidx.compose", "compose-bom") includeModule("com.android.tools", "annotations") includeModule("com.android.tools", "common") includeModule("com.android.tools", "desugar_jdk_libs") diff --git a/ui-compose/build.gradle.kts b/ui-compose/build.gradle.kts index 95a0113e..c8c96a4e 100644 --- a/ui-compose/build.gradle.kts +++ b/ui-compose/build.gradle.kts @@ -15,13 +15,14 @@ android { compose = true composeOptions { useLiveLiterals = false - kotlinCompilerExtensionVersion = libs.compose.compiler.get().versionConstraint.requiredVersion + kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get() } } namespace = "app.passwordstore.ui.compose" } dependencies { + api(platform(libs.compose.bom)) api(libs.compose.foundation.core) api(libs.compose.foundation.layout) api(libs.compose.material3)