Closed hamedsilver closed 7 months ago
There has been no updates on whether this is intended or not. It might be misleading as it clearly violates
A feature module should have no dependencies on other feature modules.
This issue is more broadly related to this bit of code: https://github.com/android/nowinandroid/blob/386f17de9924d686d5b27be50768dbf6c372edb2/build-logic/convention/src/main/kotlin/AndroidFeatureConventionPlugin.kt#L45-L67
Features should only (and explicitely) list dependencies that are necessary to build. @dturner @mmoczkowski what are your thoughts about this? Could we remove these implicit (and too broad) dependencies add by this plugin and replace them with explicit dependencies? And potentially use version catalog bundle where it would make sense?
Hey @SimonMarquis, @hamedsilver, @Omasyo I agree with you, this in my opinion is wrong. Features should not depend on other features. It violates our modularization guidance. I will address this issue, unless anyone of you want to tackle this problem.
I think I can take it (at least part of it), but it will really depend on how much we want to "factorize" dependencies.
What I was thinking is to first use a plugin like https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin to understand which are unnecessary declared dependencies, but also, and maybe most importantly, which dependencies are incorrectly declared and must be exposed as api
vs implementation
.
I've setup a local PR on my fork https://github.com/SimonMarquis/nowinandroid/pull/7 where I add this plugin and run the buildHealth
task on the project, and here are the results:
As you can see there are a lot of unnecessary dependencies, and mis-declared ones. I'll try to find some time this weekend to prepare a PR as a first step to improve the situation. 🚴♂️
I think I can take it (at least part of it), but it will really depend on how much we want to "factorize" dependencies. What I was thinking is to first use a plugin like https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin to understand which are unnecessary declared dependencies, but also, and maybe most importantly, which dependencies are incorrectly declared and must be exposed as
api
vsimplementation
.I've setup a local PR on my fork SimonMarquis#7 where I add this plugin and run the
buildHealth
task on the project, and here are the results:Click to expand...
Advice for :app Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} androidTestImplementation(project(":core:data-test")) androidTestImplementation(project(":core:datastore-test")) androidTestImplementation(project(":core:network")) debugImplementation("androidx.compose.ui:ui-test-manifest:1.3.3") implementation("androidx.appcompat:appcompat:1.5.1") implementation("androidx.core:core-ktx:1.9.0") implementation("androidx.hilt:hilt-navigation-compose:1.0.0") implementation("androidx.window:window:1.0.0") implementation(project(":core:common")) kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.annotation:annotation:1.5.0") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("androidx.compose.ui:ui-test:1.3.3") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("com.google.dagger:hilt-android-testing:2.44.2") androidTestImplementation("junit:junit:4.13.2") androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") implementation("androidx.activity:activity-ktx:1.7.0") implementation("androidx.activity:activity:1.7.0") implementation("androidx.compose.foundation:foundation-layout:1.4.0-beta01") implementation("androidx.compose.foundation:foundation:1.4.0-beta01") implementation("androidx.compose.material3:material3:1.1.0-alpha06") implementation("androidx.compose.runtime:runtime-saveable:1.4.0-beta01") implementation("androidx.compose.ui:ui-geometry:1.4.0-beta01") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("androidx.compose.ui:ui:1.4.0-beta01") implementation("androidx.core:core:1.9.0") implementation("androidx.lifecycle:lifecycle-common:2.6.1") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") implementation("androidx.lifecycle:lifecycle-viewmodel:2.6.1") implementation("androidx.metrics:metrics-performance:1.0.0-alpha03") implementation("androidx.navigation:navigation-common:2.5.3") implementation("androidx.navigation:navigation-runtime:2.5.3") implementation("androidx.tracing:tracing-ktx:1.1.0") implementation("androidx.tracing:tracing:1.1.0") implementation("com.google.dagger:dagger:2.44.2") implementation("com.google.dagger:hilt-core:2.44.2") implementation("io.coil-kt:coil-base:2.2.2") implementation("javax.inject:javax.inject:1") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") kapt("com.google.dagger:dagger-compiler:2.44.2") Existing dependencies which should be modified to be as indicated: androidTestImplementation(project(":ui-test-hilt-manifest")) (was debugImplementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("androidx.compose.runtime:runtime-tracing:1.0.0-alpha01") (was implementation) runtimeOnly("androidx.profileinstaller:profileinstaller:1.3.0") (was implementation) Advice for :app-nia-catalog Unused dependencies which should be removed: implementation(project(":core:ui")) Transitively used dependencies that should be declared directly as indicated: implementation("androidx.activity:activity:1.7.0") implementation("androidx.compose.foundation:foundation-layout:1.4.0-beta01") implementation("androidx.compose.foundation:foundation:1.4.0-beta01") implementation("androidx.compose.material3:material3:1.1.0-alpha06") implementation("androidx.compose.runtime:runtime:1.4.0-beta01") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("androidx.compose.ui:ui:1.4.0-beta01") implementation("androidx.core:core:1.9.0") implementation("androidx.lifecycle:lifecycle-common:2.6.1") implementation("androidx.lifecycle:lifecycle-viewmodel:2.6.1") Advice for :core:analytics Unused dependencies which should be removed: implementation("androidx.core:core-ktx:1.9.0") implementation("com.google.dagger:hilt-android:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") Existing dependencies which should be modified to be as indicated: api("androidx.compose.runtime:runtime:1.3.3") (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :core:common Unused dependencies which should be removed: implementation("com.google.dagger:hilt-android:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} testImplementation(project(":core:testing")) Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("app.cash.turbine:turbine:0.12.1") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :core:data Unused dependencies which should be removed: testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.annotation:annotation:1.5.0") implementation("androidx.core:core:1.9.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("androidx.datastore:datastore-core:1.0.0") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api("com.google.dagger:hilt-android:2.44.2") (was implementation) api(project(":core:analytics")) (was implementation) api(project(":core:common")) (was implementation) api(project(":core:database")) (was implementation) api(project(":core:datastore")) (was implementation) api(project(":core:model")) (was implementation) api(project(":core:network")) (was implementation) api(project(":core:notifications")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :core:data-test Unused dependencies which should be removed: implementation("com.google.dagger:hilt-android:2.44.2") implementation(project(":core:common")) implementation(project(":core:testing")) testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("com.google.dagger:hilt-android-testing:2.44.2") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") Advice for :core:database Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} androidTestImplementation(project(":core:testing")) kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.test:core:1.5.0") androidTestImplementation("junit:junit:4.13.2") androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.collection:collection:1.1.0") implementation("androidx.room:room-common:2.5.0") implementation("androidx.sqlite:sqlite:2.3.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") Existing dependencies which should be modified to be as indicated: api("androidx.room:room-runtime:2.5.0") (was implementation) api("com.google.dagger:hilt-android:2.44.2") (was implementation) api(project(":core:model")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :core:datastore Unused dependencies which should be removed: testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} testImplementation(project(":core:testing")) Transitively used dependencies that should be declared directly as indicated: api("androidx.datastore:datastore-core:1.0.0") api("com.google.dagger:dagger:2.44.2") api("com.google.protobuf:protobuf-javalite:3.23.0") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") testImplementation(project(":core:datastore")) Existing dependencies which should be modified to be as indicated: api("com.google.dagger:hilt-android:2.44.2") (was implementation) api("com.google.protobuf:protobuf-kotlin-lite:3.23.0") (was implementation) api(project(":core:common")) (was implementation) api(project(":core:model")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :core:datastore-test Unused dependencies which should be removed: api("androidx.datastore:datastore:1.0.0") implementation("com.google.dagger:hilt-android:2.44.2") implementation("com.google.protobuf:protobuf-kotlin-lite:3.23.0") implementation(project(":core:testing")) testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("androidx.datastore:datastore-core:1.0.0") api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("junit:junit:4.13.2") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("com.google.dagger:hilt-android-testing:2.44.2") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") Existing dependencies which should be modified to be as indicated: api(project(":core:common")) (was implementation) Advice for :core:designsystem Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} androidTestImplementation(project(":core:testing")) api("androidx.compose.ui:ui-util:1.4.0-beta01") debugApi("androidx.compose.ui:ui-tooling:1.3.3") implementation("androidx.core:core-ktx:1.9.0") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("junit:junit:4.13.2") api("androidx.compose.ui:ui-graphics:1.4.0-beta01") api("androidx.compose.ui:ui:1.4.0-beta01") implementation("androidx.annotation:annotation:1.5.0") implementation("androidx.compose.animation:animation-core:1.3.3") implementation("androidx.compose.animation:animation:1.3.3") implementation("androidx.compose.material:material-icons-core:1.3.1") implementation("androidx.compose.ui:ui-geometry:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") Existing dependencies which should be modified to be as indicated: implementation("androidx.compose.foundation:foundation:1.4.0-beta01") (was api) implementation("androidx.compose.material:material-icons-extended:1.3.1") (was api) implementation("androidx.compose.ui:ui-tooling-preview:1.3.3") (was api) Advice for :core:domain Unused dependencies which should be removed: implementation("com.google.dagger:hilt-android:2.44.2") implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api(project(":core:data")) (was implementation) api(project(":core:model")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Unused annotation processors that should be removed: kapt("com.google.dagger:hilt-android-compiler:2.44.2") Advice for :core:network Unused dependencies which should be removed: implementation("io.coil-kt:coil:2.2.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} testImplementation(project(":core:testing")) Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("com.squareup.okhttp3:okhttp:4.10.0") api("io.coil-kt:coil-base:2.2.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") api("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1") implementation("androidx.annotation:annotation:1.5.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api("com.google.dagger:hilt-android:2.44.2") (was implementation) api(project(":core:common")) (was implementation) api(project(":core:model")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :core:notifications Unused dependencies which should be removed: implementation("androidx.browser:browser:1.4.0") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") demoDebugApi("androidx.compose.runtime:runtime:1.3.3") implementation("androidx.core:core:1.9.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") prodDebugApi("androidx.compose.runtime:runtime:1.3.3") prodReleaseImplementation("androidx.compose.runtime:runtime:1.3.3") Existing dependencies which should be modified to be as indicated: api("com.google.dagger:hilt-android:2.44.2") (was implementation) api(project(":core:model")) (was implementation) demoReleaseImplementation("androidx.compose.runtime:runtime:1.3.3") (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :core:testing Unused dependencies which should be removed: api("androidx.compose.ui:ui-test-junit4:1.3.3") api("androidx.test.espresso:espresso-core:3.5.0") api("app.cash.turbine:turbine:0.12.1") debugApi("androidx.compose.ui:ui-test-manifest:1.3.3") implementation("com.google.dagger:hilt-android:2.44.2") implementation(project(":core:domain")) testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") demoDebugApi("androidx.compose.runtime:runtime:1.3.3") demoReleaseImplementation("androidx.compose.runtime:runtime:1.3.3") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") prodDebugApi("androidx.compose.runtime:runtime:1.3.3") prodReleaseImplementation("androidx.compose.runtime:runtime:1.3.3") Existing dependencies which should be modified to be as indicated: api(project(":core:common")) (was implementation) api(project(":core:data")) (was implementation) api(project(":core:model")) (was implementation) api(project(":core:notifications")) (was implementation) implementation("androidx.test:rules:1.5.0") (was api) implementation("com.google.dagger:hilt-android-testing:2.44.2") (was api) Dependencies which should be removed or changed to runtime-only: runtimeOnly("androidx.test:core:1.5.0") (was api) Advice for :core:ui Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} api("androidx.compose.material:material-icons-extended:1.3.1") api("androidx.compose.runtime:runtime-livedata:1.3.3") api("androidx.compose.ui:ui-util:1.4.0-beta01") api("androidx.tracing:tracing-ktx:1.1.0") debugApi("androidx.compose.ui:ui-tooling:1.3.3") implementation("androidx.core:core-ktx:1.9.0") implementation("io.coil-kt:coil:2.2.2") implementation(project(":core:domain")) testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.activity:activity:1.7.0-beta01") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("androidx.compose.ui:ui-test:1.3.3") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("junit:junit:4.13.2") api("androidx.compose.ui:ui:1.4.0-beta01") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.annotation:annotation:1.5.0") implementation("androidx.compose.ui:ui-geometry:1.4.0-beta01") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") Existing dependencies which should be modified to be as indicated: api(project(":core:analytics")) (was implementation) api(project(":core:model")) (was implementation) implementation("androidx.compose.foundation:foundation-layout:1.4.0-beta01") (was api) implementation("androidx.compose.material3:material3:1.1.0-alpha06") (was api) Advice for :feature:bookmarks Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} implementation("androidx.compose.material3:material3-window-size-class:1.1.0-alpha06") implementation("io.coil-kt:coil-compose:2.2.2") implementation("io.coil-kt:coil:2.2.2") implementation(project(":core:common")) implementation(project(":core:domain")) kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.activity:activity:1.7.0-beta01") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("androidx.compose.ui:ui-test:1.3.3") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("junit:junit:4.13.2") api("androidx.compose.foundation:foundation:1.4.0-beta01") api("androidx.compose.runtime:runtime:1.4.0-beta01") api("androidx.lifecycle:lifecycle-viewmodel:2.6.0-beta01") api("androidx.navigation:navigation-common:2.4.0") api("androidx.navigation:navigation-runtime:2.4.0") api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.annotation:annotation:1.5.0") implementation("androidx.compose.foundation:foundation-layout:1.4.0-beta01") implementation("androidx.compose.material3:material3:1.1.0-alpha06") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-tooling-preview:1.3.3") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("androidx.compose.ui:ui:1.4.0-beta01") implementation("androidx.lifecycle:lifecycle-common:2.6.0-beta01") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0-beta01") implementation("androidx.navigation:navigation-compose:2.4.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api(project(":core:data")) (was implementation) api(project(":core:ui")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :feature:foryou Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} implementation("io.coil-kt:coil-compose:2.2.2") implementation("io.coil-kt:coil:2.2.2") implementation(project(":core:common")) kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.activity:activity:1.7.0") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("androidx.compose.ui:ui-test:1.3.3") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("junit:junit:4.13.2") api("androidx.compose.animation:animation:1.3.3") api("androidx.compose.foundation:foundation-layout:1.4.0-beta01") api("androidx.compose.foundation:foundation:1.4.0-beta01") api("androidx.compose.runtime:runtime:1.4.0-beta01") api("androidx.compose.ui:ui-tooling-preview:1.3.3") api("androidx.compose.ui:ui:1.4.0-beta01") api("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1") api("androidx.lifecycle:lifecycle-viewmodel:2.6.1") api("androidx.navigation:navigation-common:2.4.0") api("androidx.navigation:navigation-runtime:2.4.0") api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.compose.animation:animation-core:1.3.3") implementation("androidx.compose.material3:material3:1.1.0-alpha06") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("androidx.compose.ui:ui-util:1.4.0-beta01") implementation("androidx.lifecycle:lifecycle-common:2.6.1") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") implementation("androidx.navigation:navigation-compose:2.4.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api(project(":core:data")) (was implementation) api(project(":core:domain")) (was implementation) api(project(":core:model")) (was implementation) api(project(":core:ui")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :feature:interests Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} implementation("io.coil-kt:coil-compose:2.2.2") implementation("io.coil-kt:coil:2.2.2") implementation(project(":core:common")) kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.activity:activity:1.7.0-beta01") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("androidx.compose.ui:ui-test:1.3.3") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("junit:junit:4.13.2") api("androidx.compose.foundation:foundation:1.4.0-beta01") api("androidx.compose.runtime:runtime:1.4.0-beta01") api("androidx.compose.ui:ui-tooling-preview:1.3.3") api("androidx.compose.ui:ui:1.4.0-beta01") api("androidx.lifecycle:lifecycle-viewmodel:2.6.0-beta01") api("androidx.navigation:navigation-common:2.4.0") api("androidx.navigation:navigation-runtime:2.4.0") api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.compose.foundation:foundation-layout:1.4.0-beta01") implementation("androidx.compose.material3:material3:1.1.0-alpha06") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("androidx.lifecycle:lifecycle-common:2.6.0-beta01") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0-beta01") implementation("androidx.navigation:navigation-compose:2.4.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api(project(":core:data")) (was implementation) api(project(":core:domain")) (was implementation) api(project(":core:model")) (was implementation) api(project(":core:ui")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :feature:search Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} implementation("io.coil-kt:coil-compose:2.2.2") implementation("io.coil-kt:coil:2.2.2") kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.activity:activity:1.7.0") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("androidx.compose.ui:ui-test:1.3.3") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("junit:junit:4.13.2") api("androidx.compose.foundation:foundation:1.4.0-beta01") api("androidx.compose.runtime:runtime:1.4.0-beta01") api("androidx.compose.ui:ui-tooling-preview:1.3.3") api("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1") api("androidx.lifecycle:lifecycle-viewmodel:2.6.1") api("androidx.navigation:navigation-common:2.4.0") api("androidx.navigation:navigation-runtime:2.4.0") api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.compose.foundation:foundation-layout:1.4.0-beta01") implementation("androidx.compose.material3:material3:1.1.0-alpha06") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("androidx.compose.ui:ui:1.4.0-beta01") implementation("androidx.lifecycle:lifecycle-common:2.6.1") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") implementation("androidx.navigation:navigation-compose:2.4.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api(project(":core:analytics")) (was implementation) api(project(":core:data")) (was implementation) api(project(":core:domain")) (was implementation) api(project(":core:model")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :feature:settings Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} androidTestImplementation(project(":core:testing")) implementation("io.coil-kt:coil-compose:2.2.2") implementation("io.coil-kt:coil:2.2.2") implementation(project(":core:common")) implementation(project(":core:domain")) kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.activity:activity:1.7.0-beta01") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("androidx.compose.ui:ui-test:1.3.3") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("junit:junit:4.13.2") api("androidx.compose.foundation:foundation-layout:1.4.0-beta01") api("androidx.compose.runtime:runtime:1.4.0-beta01") api("androidx.lifecycle:lifecycle-viewmodel:2.6.0-beta01") api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.compose.foundation:foundation:1.4.0-beta01") implementation("androidx.compose.material3:material3:1.1.0-alpha06") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-tooling-preview:1.3.3") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("androidx.compose.ui:ui:1.4.0-beta01") implementation("androidx.lifecycle:lifecycle-common:2.6.0-beta01") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0-beta01") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api(project(":core:data")) (was implementation) api(project(":core:model")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :feature:topic Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} implementation("io.coil-kt:coil-compose:2.2.2") implementation("io.coil-kt:coil:2.2.2") implementation(project(":core:domain")) kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.activity:activity:1.7.0-beta01") androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.3") androidTestImplementation("androidx.compose.ui:ui-test:1.3.3") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("junit:junit:4.13.2") api("androidx.compose.foundation:foundation:1.4.0-beta01") api("androidx.compose.runtime:runtime:1.4.0-beta01") api("androidx.compose.ui:ui-tooling-preview:1.3.3") api("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.0-beta01") api("androidx.lifecycle:lifecycle-viewmodel:2.6.0-beta01") api("androidx.navigation:navigation-common:2.4.0") api("androidx.navigation:navigation-runtime:2.4.0") api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.annotation:annotation:1.5.0") implementation("androidx.compose.foundation:foundation-layout:1.4.0-beta01") implementation("androidx.compose.material3:material3:1.1.0-alpha06") implementation("androidx.compose.ui:ui-graphics:1.4.0-beta01") implementation("androidx.compose.ui:ui-text:1.4.0-beta01") implementation("androidx.compose.ui:ui-unit:1.4.0-beta01") implementation("androidx.compose.ui:ui:1.4.0-beta01") implementation("androidx.lifecycle:lifecycle-common:2.6.0-beta01") implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0-beta01") implementation("androidx.navigation:navigation-compose:2.4.0") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") testImplementation("junit:junit:4.13.2") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") Existing dependencies which should be modified to be as indicated: api(project(":core:common")) (was implementation) api(project(":core:data")) (was implementation) api(project(":core:model")) (was implementation) api(project(":core:ui")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :lint Transitively used dependencies that should be declared directly as indicated: api("com.android.tools.external.org-jetbrains:uast:30.3.1") implementation("com.android.tools.external.com-intellij:intellij-core:30.3.1") Advice for :sync:sync-test Unused dependencies which should be removed: implementation("com.google.dagger:hilt-android:2.44.2") implementation(project(":core:testing")) testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("com.google.dagger:dagger:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("com.google.dagger:hilt-android-testing:2.44.2") implementation("com.google.dagger:hilt-core:2.44.2") kapt("com.google.dagger:dagger-compiler:2.44.2") Existing dependencies which should be modified to be as indicated: api(project(":core:data")) (was implementation) implementation(project(":sync:work")) (was api) Advice for :sync:work Unused dependencies which should be removed: androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} androidTestImplementation(project(":core:testing")) implementation(project(":core:model")) kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44.2") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} testImplementation(project(":core:testing")) Transitively used dependencies that should be declared directly as indicated: androidTestImplementation("androidx.test:monitor:1.6.0") androidTestImplementation("com.google.dagger:hilt-android-testing:2.44.2") androidTestImplementation("com.google.guava:listenablefuture:1.0") androidTestImplementation("junit:junit:4.13.2") api("androidx.work:work-runtime:2.7.1") api("com.google.dagger:dagger:2.44.2") api("com.google.dagger:hilt-core:2.44.2") api("javax.inject:javax.inject:1") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") implementation("androidx.annotation:annotation:1.5.0") implementation("androidx.core:core:1.9.0") implementation("androidx.lifecycle:lifecycle-livedata-core:2.6.0-alpha05") implementation("androidx.lifecycle:lifecycle-livedata:2.6.0-alpha05") implementation("androidx.tracing:tracing:1.1.0") kapt("com.google.dagger:dagger-compiler:2.44.2") prodDebugImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4") prodReleaseImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4") Existing dependencies which should be modified to be as indicated: api("androidx.hilt:hilt-work:1.0.0") (was implementation) api("androidx.work:work-runtime-ktx:2.7.1") (was implementation) api("com.google.dagger:hilt-android:2.44.2") (was implementation) api(project(":core:analytics")) (was implementation) api(project(":core:common")) (was implementation) api(project(":core:data")) (was implementation) api(project(":core:datastore")) (was implementation) Dependencies which should be removed or changed to runtime-only: runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") (was implementation) Advice for :ui-test-hilt-manifest Unused dependencies which should be removed: testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.22") { capabilities { requireCapability("org.jetbrains.kotlin:kotlin-test-framework-junit") }} Transitively used dependencies that should be declared directly as indicated: api("androidx.activity:activity:1.5.1") api("androidx.lifecycle:lifecycle-viewmodel:2.5.1") api("com.google.dagger:hilt-core:2.44.2") implementation("androidx.core:core:1.8.0") implementation("androidx.lifecycle:lifecycle-common:2.5.1") Existing dependencies which should be modified to be as indicated: api("com.google.dagger:hilt-android:2.44.2") (was implementation)
As you can see there are a lot of unnecessary dependencies, and mis-declared ones. I'll try to find some time this weekend to prepare a PR as a first step to improve the situation. 🚴♂️
I think the main issue is about "feature:search" that depends on: 1- ":feature:bookmarks" 2- ":feature:foryou" 3- ":feature:interests"
and this violates Modularization Guidelines , removing and arranging dependency and plugins are another issue.
Here is a PR doing that:
It currently moves the callbacks declaration up to the NiaNavHost
.
It still depends on ViewModel
s which might not be the best solution. We could extract these callbacks from VMs and inject them.
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
As I know in modular feature base Architecture's feature modules are separate from each other but in search module:
dependencies { implementation(project(":feature:bookmarks")) implementation(project(":feature:foryou")) implementation(project(":feature:interests")) implementation(libs.kotlinx.datetime) }
Does it make sense?
Relevant logcat output
No response
Code of Conduct