diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 13099b7..82d5133 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -90,6 +90,8 @@ dependencies { debugImplementation(projects.uiTestHiltManifest) debugImplementation(libs.androidx.compose.ui.testManifest) + kspTest(libs.hilt.compiler) + implementation(libs.androidx.core.ktx) implementation(libs.androidx.activity.compose) diff --git a/build-logic/convention/src/main/kotlin/AndroidHiltConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidHiltConventionPlugin.kt index 29893ce..9636db7 100644 --- a/build-logic/convention/src/main/kotlin/AndroidHiltConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidHiltConventionPlugin.kt @@ -14,8 +14,6 @@ class AndroidHiltConventionPlugin : Plugin { dependencies { "implementation"(libs.findLibrary("hilt.android").get()) "ksp"(libs.findLibrary("hilt.compiler").get()) - "kspAndroidTest"(libs.findLibrary("hilt.compiler").get()) - "kspTest"(libs.findLibrary("hilt.compiler").get()) } } diff --git a/build-logic/convention/src/main/kotlin/com/wei/picquest/KotlinAndroid.kt b/build-logic/convention/src/main/kotlin/com/wei/picquest/KotlinAndroid.kt index 6b5f144..da2ca1b 100644 --- a/build-logic/convention/src/main/kotlin/com/wei/picquest/KotlinAndroid.kt +++ b/build-logic/convention/src/main/kotlin/com/wei/picquest/KotlinAndroid.kt @@ -62,12 +62,11 @@ private fun Project.configureKotlin() { // Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties val warningsAsErrors: String? by project allWarningsAsErrors = warningsAsErrors.toBoolean() - freeCompilerArgs = freeCompilerArgs + listOf( - "-opt-in=kotlin.RequiresOptIn", - // Enable experimental coroutines APIs, including Flow - "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - "-opt-in=kotlinx.coroutines.FlowPreview", - ) + freeCompilerArgs = freeCompilerArgs + + listOf( + // Enable experimental coroutines APIs, including Flow + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + ) } } } diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts index 9e577a4..c664267 100644 --- a/core/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -13,8 +13,6 @@ android { } dependencies { - implementation(projects.core.model) - // LifeCycle implementation(libs.androidx.lifecycle.runtimeCompose) diff --git a/core/common/src/main/java/com/wei/picquest/core/network/di/CoroutineScopesModule.kt b/core/common/src/main/java/com/wei/picquest/core/network/di/CoroutineScopesModule.kt index a144817..985816d 100644 --- a/core/common/src/main/java/com/wei/picquest/core/network/di/CoroutineScopesModule.kt +++ b/core/common/src/main/java/com/wei/picquest/core/network/di/CoroutineScopesModule.kt @@ -18,7 +18,7 @@ annotation class ApplicationScope @Module @InstallIn(SingletonComponent::class) -object CoroutineScopesModule { +internal object CoroutineScopesModule { @Provides @Singleton @ApplicationScope diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index 365a5eb..5113012 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -15,10 +15,10 @@ android { } dependencies { - implementation(projects.core.common) - implementation(projects.core.network) - implementation(projects.core.model) - implementation(projects.core.datastore) + api(projects.core.common) + api(projects.core.network) + api(projects.core.model) + api(projects.core.datastore) implementation(libs.kotlinx.serialization.json) } \ No newline at end of file diff --git a/core/data/src/main/java/com/wei/picquest/core/data/di/DataModule.kt b/core/data/src/main/java/com/wei/picquest/core/data/di/DataModule.kt index 7613291..a0503ac 100644 --- a/core/data/src/main/java/com/wei/picquest/core/data/di/DataModule.kt +++ b/core/data/src/main/java/com/wei/picquest/core/data/di/DataModule.kt @@ -15,25 +15,25 @@ import dagger.hilt.components.SingletonComponent @Module @InstallIn(SingletonComponent::class) -interface DataModule { +abstract class DataModule { @Binds - fun bindsSearchImagesRepository( + internal abstract fun bindsSearchImagesRepository( searchImagesRepository: DefaultSearchImagesRepository, ): SearchImagesRepository @Binds - fun bindsSearchVideosRepository( + internal abstract fun bindsSearchVideosRepository( searchVideosRepository: DefaultSearchVideosRepository, ): SearchVideosRepository @Binds - fun bindsNetworkMonitor( + internal abstract fun bindsNetworkMonitor( networkMonitor: ConnectivityManagerNetworkMonitor, ): NetworkMonitor @Binds - fun bindsUserDataRepository( + internal abstract fun bindsUserDataRepository( userDataRepository: DefaultUserDataRepository, ): UserDataRepository } diff --git a/core/datastore-test/src/main/java/com/wei/picquest/core/datastore/test/TestDataStoreModule.kt b/core/datastore-test/src/main/java/com/wei/picquest/core/datastore/test/TestDataStoreModule.kt index 5d4c867..c02d721 100644 --- a/core/datastore-test/src/main/java/com/wei/picquest/core/datastore/test/TestDataStoreModule.kt +++ b/core/datastore-test/src/main/java/com/wei/picquest/core/datastore/test/TestDataStoreModule.kt @@ -19,7 +19,7 @@ import javax.inject.Singleton components = [SingletonComponent::class], replaces = [DataStoreModule::class], ) -object TestDataStoreModule { +internal object TestDataStoreModule { @Provides @Singleton diff --git a/core/domain/build.gradle.kts b/core/domain/build.gradle.kts index bd54faf..7058d51 100644 --- a/core/domain/build.gradle.kts +++ b/core/domain/build.gradle.kts @@ -8,8 +8,6 @@ android { } dependencies { - implementation(projects.core.common) - implementation(projects.core.data) - implementation(projects.core.model) - implementation(projects.core.network) + api(projects.core.data) + api(projects.core.model) } \ No newline at end of file diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index c8f3b87..802c5d7 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -24,7 +24,8 @@ secrets { } dependencies { - implementation(projects.core.common) + api(projects.core.common) + api(projects.core.model) // Okhttp Interceptor implementation(libs.okhttp.logging) diff --git a/core/network/src/main/java/com/wei/picquest/core/network/di/FlavoredNetworkModule.kt b/core/network/src/main/java/com/wei/picquest/core/network/di/FlavoredNetworkModule.kt index a0d5333..657bb10 100644 --- a/core/network/src/main/java/com/wei/picquest/core/network/di/FlavoredNetworkModule.kt +++ b/core/network/src/main/java/com/wei/picquest/core/network/di/FlavoredNetworkModule.kt @@ -12,7 +12,7 @@ import dagger.hilt.components.SingletonComponent */ @Module @InstallIn(SingletonComponent::class) -interface FlavoredNetworkModule { +internal interface FlavoredNetworkModule { @Binds fun binds(implementation: RetrofitPqNetwork): PqNetworkDataSource diff --git a/core/network/src/main/java/com/wei/picquest/core/network/di/NetworkModule.kt b/core/network/src/main/java/com/wei/picquest/core/network/di/NetworkModule.kt index 57ec455..b18aa5a 100644 --- a/core/network/src/main/java/com/wei/picquest/core/network/di/NetworkModule.kt +++ b/core/network/src/main/java/com/wei/picquest/core/network/di/NetworkModule.kt @@ -13,7 +13,7 @@ import javax.inject.Singleton @Module @InstallIn(SingletonComponent::class) -object NetworkModule { +internal object NetworkModule { @Provides @Singleton diff --git a/core/testing/build.gradle.kts b/core/testing/build.gradle.kts index 6ddd80e..8bb7a31 100644 --- a/core/testing/build.gradle.kts +++ b/core/testing/build.gradle.kts @@ -10,12 +10,8 @@ android { dependencies { - implementation(projects.core.common) - implementation(projects.core.data) - implementation(projects.core.model) - implementation(projects.core.domain) - implementation(projects.core.network) - implementation(projects.core.designsystem) + api(projects.core.data) + api(projects.core.model) api(libs.junit4) api(libs.androidx.activity.compose) @@ -38,4 +34,7 @@ dependencies { api(libs.roborazzi) debugApi(libs.androidx.compose.ui.testManifest) + + implementation(projects.core.common) + implementation(projects.core.designsystem) } diff --git a/docs/images/modularization-graph.drawio.png b/docs/images/modularization-graph.drawio.png index a62a537..4e4632d 100644 Binary files a/docs/images/modularization-graph.drawio.png and b/docs/images/modularization-graph.drawio.png differ