Skip to content

Commit

Permalink
Update dependency sturcture
Browse files Browse the repository at this point in the history
  • Loading branch information
shounakmulay committed May 25, 2022
1 parent 8270f7a commit d2db3d5
Show file tree
Hide file tree
Showing 33 changed files with 359 additions and 337 deletions.
12 changes: 6 additions & 6 deletions app/app.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ dependencies {
implementation(project(":repo-di"))
implementation(project(":service-di"))

implementation(Dependencies.kotlinStdLib)
implementation(Dependencies.Kotlin.stdLib)

implementation(Dependencies.koinCore)
implementation(Dependencies.koinAndroid)
implementation(Dependencies.Koin.core)
implementation(Dependencies.Koin.android)

implementation(Dependencies.material)
implementation(Dependencies.Material.material)

implementation(Dependencies.loggingTimber)
implementation(Dependencies.Logging.timber)

implementation(Dependencies.androidSplashScreen)
implementation(Dependencies.Android.splashScreen)
}
39 changes: 0 additions & 39 deletions build.gradle

This file was deleted.

22 changes: 22 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath(Dependencies.Android.gradlePlugin)
classpath(Dependencies.Google.services)
classpath(Dependencies.Kotlin.gradlePlugin)
classpath(Dependencies.Kotlin.serializationPlugin)
classpath(Dependencies.Android.navigationSafeArgsPlugin)
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}
186 changes: 103 additions & 83 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,96 +1,116 @@
object Dependencies {

// Compose
const val activityCompose = "androidx.activity:activity-compose:${Versions.activityCompose}"
const val composeMaterial = "androidx.compose.material:material:${Versions.compose}"
const val composeMaterialIconCore = "androidx.compose.material:material-icons-core:${Versions.compose}"
const val composeMaterialIconExtended = "androidx.compose.material:material-icons-extended:${Versions.compose}"
const val composeFoundation = "androidx.compose.foundation:foundation:${Versions.compose}"
const val composeRuntime = "androidx.compose.runtime:runtime:${Versions.compose}"
const val composeLiveData = "androidx.compose.runtime:runtime-livedata:${Versions.compose}"
const val composeAnimation = "androidx.compose.animation:animation:${Versions.compose}"
const val composeUiTooling = "androidx.compose.ui:ui-tooling:${Versions.compose}"
const val viewModelCompose = "androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.lifecycleViewModelCompose}"
const val composeUiTest = "androidx.compose.ui:ui-test-junit4:${Versions.compose}"
object Compose {
const val activity = "androidx.activity:activity-compose:${Versions.activityCompose}"
const val material = "androidx.compose.material:material:${Versions.compose}"
const val materialIconCore =
"androidx.compose.material:material-icons-core:${Versions.compose}"
const val materialIconExtended =
"androidx.compose.material:material-icons-extended:${Versions.compose}"
const val foundation = "androidx.compose.foundation:foundation:${Versions.compose}"
const val runtime = "androidx.compose.runtime:runtime:${Versions.compose}"
const val liveData = "androidx.compose.runtime:runtime-livedata:${Versions.compose}"
const val animation = "androidx.compose.animation:animation:${Versions.compose}"
const val uiTooling = "androidx.compose.ui:ui-tooling:${Versions.compose}"
const val viewModel =
"androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.lifecycleViewModelCompose}"
const val uiTest = "androidx.compose.ui:ui-test-junit4:${Versions.compose}"
}

// Room
const val roomRuntime = "androidx.room:room-runtime:${Versions.room}"
const val roomKtx = "androidx.room:room-ktx:${Versions.room}"
const val roomCompiler = "androidx.room:room-compiler:${Versions.room}"
object Room {
const val runtime = "androidx.room:room-runtime:${Versions.room}"
const val ktx = "androidx.room:room-ktx:${Versions.room}"
const val compiler = "androidx.room:room-compiler:${Versions.room}"
}

// Kotlin
const val kotlinStdLib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
const val kotlinSerialization =
"org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.kotlinxSerialization}"
object Kotlin {
const val stdLib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
const val serialization =
"org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.kotlinxSerialization}"
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
const val serializationPlugin = "org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}"
}

// Coroutines
const val coroutinesCore =
"org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}"
const val coroutinesAndroid =
"org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.coroutines}"
object Coroutines {
const val core =
"org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}"
const val android =
"org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.coroutines}"
}

// Koin
const val koinCore = "io.insert-koin:koin-core:${Versions.koin}"
const val koinAndroid = "io.insert-koin:koin-android:${Versions.koin}"
const val koinWorkManager = "io.insert-koin:koin-androidx-workmanager:${Versions.koin}"
const val koinTest = "io.insert-koin:koin-test:${Versions.koin}"
const val koinNavigation = "io.insert-koin:koin-androidx-navigation:${Versions.koin}"
const val koinCompose = "io.insert-koin:koin-androidx-compose:${Versions.koin}"
object Koin {
const val core = "io.insert-koin:koin-core:${Versions.koin}"
const val android = "io.insert-koin:koin-android:${Versions.koin}"
const val workManager = "io.insert-koin:koin-androidx-workmanager:${Versions.koin}"
const val test = "io.insert-koin:koin-test:${Versions.koin}"
const val navigation = "io.insert-koin:koin-androidx-navigation:${Versions.koin}"
const val compose = "io.insert-koin:koin-androidx-compose:${Versions.koin}"
}

// Material
const val material = "com.google.android.material:material:${Versions.material}"
object Material {
const val material = "com.google.android.material:material:${Versions.material}"
}

// AndroidX
const val androidCoreKtx = "androidx.core:core-ktx:${Versions.core}"
const val androidFragment = "androidx.fragment:fragment:${Versions.fragment}"
const val androidAppCompat = "androidx.appcompat:appcompat:${Versions.appCompat}"
const val androidConstraintLayout =
"androidx.constraintlayout:constraintlayout:${Versions.constraintLayout}"
const val androidRecyclerView = "androidx.recyclerview:recyclerview:${Versions.recyclerView}"
const val androidLifecycleCompiler =
"androidx.lifecycle:lifecycle-compiler:${Versions.lifecycle}"
const val androidRecyclerViewSelection =
"androidx.recyclerview:recyclerview-selection:${Versions.recyclerViewSelection}"
const val androidLifecycleLiveDataCore =
"androidx.lifecycle:lifecycle-livedata-core:${Versions.lifecycle}"
const val androidLifecycleLiveDataKtx =
"androidx.lifecycle:lifecycle-livedata-ktx:${Versions.lifecycle}"
const val androidLifecycleViewModelKtx =
"androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycle}"
const val androidLifecycleViewModel =
"androidx.lifecycle:lifecycle-viewmodel:${Versions.lifecycle}"
const val androidLifecycleRuntimeKtx =
"androidx.lifecycle:lifecycle-runtime-ktx:${Versions.lifecycle}"
const val androidNavigationFragment =
"androidx.navigation:navigation-fragment-ktx:${Versions.nav}"
const val androidNavigationUi = "androidx.navigation:navigation-ui-ktx:${Versions.nav}"
const val androidSplashScreen = "androidx.core:core-splashscreen:${Versions.splash}"
object Google {
const val services = "com.google.gms:google-services:${Versions.googleServices}"
}

object Android {
const val gradlePlugin = "com.android.tools.build:gradle:${Versions.androidGradlePlugin}"
const val coreKtx = "androidx.core:core-ktx:${Versions.core}"
const val fragment = "androidx.fragment:fragment:${Versions.fragment}"
const val appCompat = "androidx.appcompat:appcompat:${Versions.appCompat}"
const val constraintLayout =
"androidx.constraintlayout:constraintlayout:${Versions.constraintLayout}"
const val recyclerView =
"androidx.recyclerview:recyclerview:${Versions.recyclerView}"
const val lifecycleCompiler =
"androidx.lifecycle:lifecycle-compiler:${Versions.lifecycle}"
const val recyclerViewSelection =
"androidx.recyclerview:recyclerview-selection:${Versions.recyclerViewSelection}"
const val lifecycleLiveDataCore =
"androidx.lifecycle:lifecycle-livedata-core:${Versions.lifecycle}"
const val lifecycleLiveDataKtx =
"androidx.lifecycle:lifecycle-livedata-ktx:${Versions.lifecycle}"
const val lifecycleViewModelKtx =
"androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycle}"
const val lifecycleViewModel =
"androidx.lifecycle:lifecycle-viewmodel:${Versions.lifecycle}"
const val lifecycleRuntimeKtx =
"androidx.lifecycle:lifecycle-runtime-ktx:${Versions.lifecycle}"
const val navigationFragment =
"androidx.navigation:navigation-fragment-ktx:${Versions.nav}"
const val navigationUi = "androidx.navigation:navigation-ui-ktx:${Versions.nav}"
const val navigationSafeArgsPlugin = "androidx.navigation:navigation-safe-args-gradle-plugin:${Versions.nav}"
const val splashScreen = "androidx.core:core-splashscreen:${Versions.splash}"
}

// Retrofit
const val retrofitCore = "com.squareup.retrofit2:retrofit:${Versions.retrofit}"
const val retrofitSerialization =
"com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:${Versions.retrofitKotlinxSerializationConverter}"
const val retrofitLogging =
"com.squareup.okhttp3:logging-interceptor:${Versions.retrofitLoggingInterceptor}"
object Retrofit {
const val core = "com.squareup.retrofit2:retrofit:${Versions.retrofit}"
const val serialization =
"com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:${Versions.retrofitKotlinxSerializationConverter}"
const val logging =
"com.squareup.okhttp3:logging-interceptor:${Versions.retrofitLoggingInterceptor}"
}

// Logging
const val loggingTimber = "com.jakewharton.timber:timber:${Versions.timber}"
const val loggingChucker = "com.github.chuckerteam.chucker:library:${Versions.chucker}"
object Logging {
const val timber = "com.jakewharton.timber:timber:${Versions.timber}"
const val chucker = "com.github.chuckerteam.chucker:library:${Versions.chucker}"
}


// Test
const val testAndroidxTestCore = "androidx.test:runner:1.3.0"
const val testAndroidxArchCore = "androidx.arch.core:core-testing:2.1.0"
const val testAndroidxTestRunner = "androidx.test:runner:1.3.0"
const val testAndroidxTestRules = "androidx.test:rules:1.3.0"
const val testAndroidxExt = "androidx.test.ext:junit:1.1.2"
const val testAndroidxCoreTesting = "androidx.arch.core:core-testing:2.1.0"
const val testAndroidxRoomTesting = "androidx.room:room-testing:2.2.5"
const val testJunit = "junit:junit:4.13.2"
const val testCoroutines =
"org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.coroutines}"
const val testFlowTest = "app.cash.turbine:turbine:0.6.0"
const val testKotlinTest = "org.jetbrains.kotlin:kotlin-test:${Versions.kotlin}"
const val testMockito = "org.mockito.kotlin:mockito-kotlin:3.2.0"
object Test {
const val androidxTestCore = "androidx.test:runner:1.3.0"
const val androidxArchCore = "androidx.arch.core:core-testing:2.1.0"
const val androidxTestRunner = "androidx.test:runner:1.3.0"
const val androidxTestRules = "androidx.test:rules:1.3.0"
const val androidxExt = "androidx.test.ext:junit:1.1.2"
const val androidxCoreTesting = "androidx.arch.core:core-testing:2.1.0"
const val androidxRoomTesting = "androidx.room:room-testing:2.2.5"
const val junit = "junit:junit:4.13.2"
const val coroutines =
"org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.coroutines}"
const val flowTest = "app.cash.turbine:turbine:0.6.0"
const val kotlinTest = "org.jetbrains.kotlin:kotlin-test:${Versions.kotlin}"
const val mockito = "org.mockito.kotlin:mockito-kotlin:3.2.0"
}
}
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
object Versions {
const val androidGradlePlugin = "7.2.0"
const val googleServices = "4.3.10"
const val compose = "1.1.1"
const val activityCompose = "1.4.0"
const val lifecycleViewModelCompose = "2.4.1"
Expand Down
2 changes: 1 addition & 1 deletion domain-di/domain-di.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ dependencies {
implementation(project(":repo"))
implementation(project(":domain-impl"))

implementation(Dependencies.koinCore)
implementation(Dependencies.Koin.core)
}
8 changes: 4 additions & 4 deletions domain-entity/domain-entity.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ apply {

dependencies {

implementation(Dependencies.androidCoreKtx)
implementation(Dependencies.androidAppCompat)
implementation(Dependencies.material)
implementation(Dependencies.Android.coreKtx)
implementation(Dependencies.Android.appCompat)
implementation(Dependencies.Material.material)

testImplementation(Dependencies.testJunit)
testImplementation(Dependencies.Test.junit)
}
16 changes: 8 additions & 8 deletions domain-impl/domain-impl.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ dependencies {
implementation(project(":domain-entity"))
implementation(project(":repo"))

implementation(Dependencies.kotlinStdLib)
implementation(Dependencies.coroutinesCore)
implementation(Dependencies.Kotlin.stdLib)
implementation(Dependencies.Coroutines.core)

implementation(Dependencies.loggingTimber)
implementation(Dependencies.Logging.timber)

testImplementation(Dependencies.testJunit)
testImplementation(Dependencies.testKotlinTest)
testImplementation(Dependencies.testMockito)
testImplementation(Dependencies.testFlowTest)
testImplementation(Dependencies.testCoroutines)
testImplementation(Dependencies.Test.junit)
testImplementation(Dependencies.Test.kotlinTest)
testImplementation(Dependencies.Test.mockito)
testImplementation(Dependencies.Test.flowTest)
testImplementation(Dependencies.Test.coroutines)
}
4 changes: 2 additions & 2 deletions domain/domain.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ apply {
dependencies {
implementation(project(":domain-entity"))

implementation(Dependencies.kotlinStdLib)
implementation(Dependencies.coroutinesCore)
implementation(Dependencies.Kotlin.stdLib)
implementation(Dependencies.Coroutines.core)
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
2 changes: 1 addition & 1 deletion interactor-di/interactor-di.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ dependencies {
implementation(project(":interactor-impl"))
implementation(project(":domain"))

implementation(Dependencies.koinCore)
implementation(Dependencies.Koin.core)
}
Loading

0 comments on commit d2db3d5

Please sign in to comment.