Skip to content

Commit

Permalink
Merge pull request #90 from azrael8576/chore/cleanup-dependencies
Browse files Browse the repository at this point in the history
Reduce overall build complexity
  • Loading branch information
azrael8576 authored Jan 26, 2024
2 parents cab14ce + afe1eff commit 1b8f63e
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 34 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class AndroidHiltConventionPlugin : Plugin<Project> {
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())
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
}
}
}
2 changes: 0 additions & 2 deletions core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ android {
}

dependencies {
implementation(projects.core.model)

// LifeCycle
implementation(libs.androidx.lifecycle.runtimeCompose)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ annotation class ApplicationScope

@Module
@InstallIn(SingletonComponent::class)
object CoroutineScopesModule {
internal object CoroutineScopesModule {
@Provides
@Singleton
@ApplicationScope
Expand Down
8 changes: 4 additions & 4 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import javax.inject.Singleton
components = [SingletonComponent::class],
replaces = [DataStoreModule::class],
)
object TestDataStoreModule {
internal object TestDataStoreModule {

@Provides
@Singleton
Expand Down
6 changes: 2 additions & 4 deletions core/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
3 changes: 2 additions & 1 deletion core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ secrets {
}

dependencies {
implementation(projects.core.common)
api(projects.core.common)
api(projects.core.model)

// Okhttp Interceptor
implementation(libs.okhttp.logging)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import dagger.hilt.components.SingletonComponent
*/
@Module
@InstallIn(SingletonComponent::class)
interface FlavoredNetworkModule {
internal interface FlavoredNetworkModule {

@Binds
fun binds(implementation: RetrofitPqNetwork): PqNetworkDataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object NetworkModule {
internal object NetworkModule {

@Provides
@Singleton
Expand Down
11 changes: 5 additions & 6 deletions core/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -38,4 +34,7 @@ dependencies {
api(libs.roborazzi)

debugApi(libs.androidx.compose.ui.testManifest)

implementation(projects.core.common)
implementation(projects.core.designsystem)
}
Binary file modified docs/images/modularization-graph.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1b8f63e

Please sign in to comment.