From 70e49c4f7ca0373582e434d9dd99474dcad5f5af Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 30 Jan 2025 12:58:25 +0200 Subject: [PATCH 1/5] Deps: Extract androidx compose versions to root build gradle --- build.gradle | 3 +++ media-placeholders/build.gradle | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 5e67c2414..088254b9c 100644 --- a/build.gradle +++ b/build.gradle @@ -72,6 +72,9 @@ ext { ext { // mixed + androidxComposeCompilerVersion = '1.5.14' + androidxComposeLibraryVersion = '1.7.5' + androidxComposeMaterialVersion = '1.3.1' gradlePluginVersion = '3.3.1' kotlinCoroutinesVersion = '1.8.1' tagSoupVersion = '1.2.1' diff --git a/media-placeholders/build.gradle b/media-placeholders/build.gradle index ea3c12a76..02ebe975b 100644 --- a/media-placeholders/build.gradle +++ b/media-placeholders/build.gradle @@ -36,7 +36,7 @@ android { compose true } composeOptions { - kotlinCompilerExtensionVersion = "1.5.14" + kotlinCompilerExtensionVersion = androidxComposeCompilerVersion } } @@ -47,10 +47,10 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesVersion" testImplementation "junit:junit:$jUnitVersion" testImplementation "org.robolectric:robolectric:$robolectricVersion" - implementation 'androidx.compose.material3:material3:1.3.1' - implementation 'androidx.compose.foundation:foundation:1.7.5' - implementation 'androidx.compose.ui:ui:1.7.5' - implementation 'androidx.compose.ui:ui-tooling-preview:1.7.5' + implementation "androidx.compose.material3:material3:$androidxComposeMaterialVersion" + implementation "androidx.compose.foundation:foundation:$androidxComposeLibraryVersion" + implementation "androidx.compose.ui:ui:$androidxComposeLibraryVersion" + implementation "androidx.compose.ui:ui-tooling-preview:$androidxComposeLibraryVersion" } dependencyAnalysis { From 644f3399bd96059119294e1f14b82350a60800cd Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 30 Jan 2025 13:02:09 +0200 Subject: [PATCH 2/5] Deps: Remove androidx compose material dep from media ph This dependency is completely unused. FYI: It got introduced as part of this (7d8d37c5bf1d5739b6f0bae4f1c21faf4ae1da3b) commit, a part of implementing placeholders in compose. ------------------------------------------------------------------------ This removal was suggested by the dependency analysis report, see below: Advice for :media-placeholders Unused dependencies which should be removed: ... implementation 'androidx.compose.material3:material3:1.3.1' ... --- build.gradle | 1 - media-placeholders/build.gradle | 1 - 2 files changed, 2 deletions(-) diff --git a/build.gradle b/build.gradle index 088254b9c..79057a732 100644 --- a/build.gradle +++ b/build.gradle @@ -74,7 +74,6 @@ ext { // mixed androidxComposeCompilerVersion = '1.5.14' androidxComposeLibraryVersion = '1.7.5' - androidxComposeMaterialVersion = '1.3.1' gradlePluginVersion = '3.3.1' kotlinCoroutinesVersion = '1.8.1' tagSoupVersion = '1.2.1' diff --git a/media-placeholders/build.gradle b/media-placeholders/build.gradle index 02ebe975b..217c39250 100644 --- a/media-placeholders/build.gradle +++ b/media-placeholders/build.gradle @@ -47,7 +47,6 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesVersion" testImplementation "junit:junit:$jUnitVersion" testImplementation "org.robolectric:robolectric:$robolectricVersion" - implementation "androidx.compose.material3:material3:$androidxComposeMaterialVersion" implementation "androidx.compose.foundation:foundation:$androidxComposeLibraryVersion" implementation "androidx.compose.ui:ui:$androidxComposeLibraryVersion" implementation "androidx.compose.ui:ui-tooling-preview:$androidxComposeLibraryVersion" From 9a13982f9eda6e9ca3f2fc6b68523f11008d1019 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 30 Jan 2025 13:04:06 +0200 Subject: [PATCH 3/5] Deps: Remove androidx compose ui tooling preview dep from media ph This dependency is completely unused. FYI: It got introduced as part of this (7d8d37c5bf1d5739b6f0bae4f1c21faf4ae1da3b) commit, a part of implementing placeholders in compose. ------------------------------------------------------------------------ This removal was suggested by the dependency analysis report, see below: Advice for :media-placeholders Unused dependencies which should be removed: ... implementation 'androidx.compose.ui:ui-tooling-preview:1.7.5' --- media-placeholders/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/media-placeholders/build.gradle b/media-placeholders/build.gradle index 217c39250..27ea50e1d 100644 --- a/media-placeholders/build.gradle +++ b/media-placeholders/build.gradle @@ -49,7 +49,6 @@ dependencies { testImplementation "org.robolectric:robolectric:$robolectricVersion" implementation "androidx.compose.foundation:foundation:$androidxComposeLibraryVersion" implementation "androidx.compose.ui:ui:$androidxComposeLibraryVersion" - implementation "androidx.compose.ui:ui-tooling-preview:$androidxComposeLibraryVersion" } dependencyAnalysis { From adae1fa301c7a19d95833a1bee1ac402567078a4 Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 30 Jan 2025 13:07:01 +0200 Subject: [PATCH 4/5] Deps: Add transitive androidx compose ui unit dep to media ph Although removing the 'androidx.compose.ui:ui' is enough by itself and the build is okay, it is better to add 'androidx.compose.ui:ui-unit' for transitive dependency related purposes. FYI: It got introduced as part of this (7d8d37c5bf1d5739b6f0bae4f1c21faf4ae1da3b) commit, a part of implementing placeholders in compose. ------------------------------------------------------------------------ This addition was suggested by the dependency analysis report, see below: These transitive dependencies should be declared directly: ... implementation 'androidx.compose.ui:ui-unit:1.7.5' ... --- media-placeholders/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/media-placeholders/build.gradle b/media-placeholders/build.gradle index 27ea50e1d..9aee73c69 100644 --- a/media-placeholders/build.gradle +++ b/media-placeholders/build.gradle @@ -49,6 +49,7 @@ dependencies { testImplementation "org.robolectric:robolectric:$robolectricVersion" implementation "androidx.compose.foundation:foundation:$androidxComposeLibraryVersion" implementation "androidx.compose.ui:ui:$androidxComposeLibraryVersion" + implementation "androidx.compose.ui:ui-unit:$androidxComposeLibraryVersion" } dependencyAnalysis { From 884864d6d4264f109ff0e287f0c6924440fc30be Mon Sep 17 00:00:00 2001 From: Petros Paraskevopoulos Date: Thu, 30 Jan 2025 13:11:15 +0200 Subject: [PATCH 5/5] Deps: Replace androidx compose foundation with foundation layout Removing the 'androidx.compose.foundation:foundation' dependency wasn't enough by itself as the build was then failing. Adding the transient 'androidx.compose.foundation:foundation-layout' dependency was actually required in order to make the build successful again. FYI: It got introduced as part of this (7d8d37c5bf1d5739b6f0bae4f1c21faf4ae1da3b) commit, a part of implementing placeholders in compose. ------------------------------------------------------------------------ This replacement was suggested by the dependency analysis report, see below: Unused dependencies which should be removed: implementation 'androidx.compose.foundation:foundation:1.7.5' ... These transitive dependencies should be declared directly: ... implementation 'androidx.compose.foundation:foundation-layout:1.7.5' ... --- media-placeholders/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media-placeholders/build.gradle b/media-placeholders/build.gradle index 9aee73c69..fdee11a97 100644 --- a/media-placeholders/build.gradle +++ b/media-placeholders/build.gradle @@ -47,7 +47,7 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinCoroutinesVersion" testImplementation "junit:junit:$jUnitVersion" testImplementation "org.robolectric:robolectric:$robolectricVersion" - implementation "androidx.compose.foundation:foundation:$androidxComposeLibraryVersion" + implementation "androidx.compose.foundation:foundation-layout:$androidxComposeLibraryVersion" implementation "androidx.compose.ui:ui:$androidxComposeLibraryVersion" implementation "androidx.compose.ui:ui-unit:$androidxComposeLibraryVersion" }