Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: transition to version catalogs #266

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ dependencies {
implementation(libs.androidx.compose.material3)
implementation(Deps.Compose.coilCompose)

with(Deps.Koin) {
implementation(core)
implementation(android)
implementation(compose)
testImplementation(test)
testImplementation(testJUnit4)
}
implementation(libs.koin.core)
implementation(libs.koin.android)
implementation(libs.koin.androidx.compose)
implementation(libs.koin.test)
implementation(libs.koin.test.junit4)

with(Deps.Test) {
testImplementation(junit)
Expand Down
45 changes: 16 additions & 29 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ object Versions {
const val mockito = "3.11.2"
const val robolectric = "4.10"

const val sqlDelight = "2.0.0"
const val shadow = "7.0.0"
const val kotlinterGradle = "3.4.5"

Expand All @@ -40,9 +39,8 @@ object Versions {
const val kotlinReactRouterDom = "5.1.2-pre.110-kotlin-1.4.0"
const val kotlinStyled = "5.2.1-pre.146-kotlin-1.4.30"

const val slf4j = "1.7.30"
//const val slf4j = "1.7.30"
const val logback = "1.2.3"
const val kermit = "2.0.0-RC4"

const val gradleVersionsPlugin = "0.39.0"
}
Expand All @@ -58,14 +56,14 @@ object Deps {
object Gradle {
const val kotlinter = "org.jmailen.gradle:kotlinter-gradle:${Versions.kotlinterGradle}"
const val shadow = "gradle.plugin.com.github.jengelman.gradle.plugins:shadow:${Versions.shadow}"
const val sqlDelight = "app.cash.sqldelight:gradle-plugin:${Versions.sqlDelight}"
//const val sqlDelight = "app.cash.sqldelight:gradle-plugin:${Versions.sqlDelight}"
const val gradleVersionsPlugin = "com.github.ben-manes:gradle-versions-plugin:${Versions.gradleVersionsPlugin}"
}

object Kotlinx {
const val serializationCore = "org.jetbrains.kotlinx:kotlinx-serialization-core:${Versions.kotlinxSerialization}"
const val coroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}"
const val coroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.kotlinCoroutines}"
//const val coroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.kotlinCoroutines}"
const val htmlJs = "org.jetbrains.kotlinx:kotlinx-html-js:${Versions.kotlinxHtmlJs}"
}

Expand Down Expand Up @@ -112,13 +110,13 @@ object Deps {
const val composeImageLoader = "io.github.qdsfdhvh:image-loader:1.2.9"
}

object Koin {
const val core = "io.insert-koin:koin-core:${Versions.koinCore}"
const val test = "io.insert-koin:koin-test:${Versions.koinCore}"
const val testJUnit4 = "io.insert-koin:koin-test-junit4:${Versions.koinCore}"
const val android = "io.insert-koin:koin-android:${Versions.koinAndroid}"
const val compose = "io.insert-koin:koin-androidx-compose:${Versions.koinAndroidCompose}"
}
// object Koin {
// const val core = "io.insert-koin:koin-core:${Versions.koinCore}"
// const val test = "io.insert-koin:koin-test:${Versions.koinCore}"
// const val testJUnit4 = "io.insert-koin:koin-test-junit4:${Versions.koinCore}"
// const val android = "io.insert-koin:koin-android:${Versions.koinAndroid}"
// const val compose = "io.insert-koin:koin-androidx-compose:${Versions.koinAndroidCompose}"
// }

object Ktor {
const val serverCore = "io.ktor:ktor-server-core:${Versions.ktor}"
Expand All @@ -132,21 +130,11 @@ object Deps {
const val clientCore = "io.ktor:ktor-client-core:${Versions.ktor}"
const val clientJson = "io.ktor:ktor-client-json:${Versions.ktor}"
const val clientLogging = "io.ktor:ktor-client-logging:${Versions.ktor}"
const val clientSerialization = "io.ktor:ktor-client-serialization:${Versions.ktor}"
const val clientAndroid = "io.ktor:ktor-client-android:${Versions.ktor}"
const val clientJava = "io.ktor:ktor-client-java:${Versions.ktor}"
const val clientDarwin = "io.ktor:ktor-client-darwin:${Versions.ktor}"
const val clientJs = "io.ktor:ktor-client-js:${Versions.ktor}"
}

object SqlDelight {
const val runtime = "app.cash.sqldelight:runtime:${Versions.sqlDelight}"
const val coroutineExtensions = "app.cash.sqldelight:coroutines-extensions:${Versions.sqlDelight}"
const val androidDriver = "app.cash.sqldelight:android-driver:${Versions.sqlDelight}"
const val nativeDriver = "app.cash.sqldelight:native-driver:${Versions.sqlDelight}"
//const val nativeDriverMacos = "app.cash.sqldelight:native-driver-macosx64:${Versions.sqlDelight}"
const val nativeDriverMacos = "app.cash.sqldelight:native-driver-macosarm64:${Versions.sqlDelight}"
const val sqliteDriver = "app.cash.sqldelight:sqlite-driver:${Versions.sqlDelight}"
// const val clientSerialization = "io.ktor:ktor-client-serialization:${Versions.ktor}"
// const val clientAndroid = "io.ktor:ktor-client-android:${Versions.ktor}"
// const val clientJava = "io.ktor:ktor-client-java:${Versions.ktor}"
// const val clientDarwin = "io.ktor:ktor-client-darwin:${Versions.ktor}"
// const val clientJs = "io.ktor:ktor-client-js:${Versions.ktor}"
}

object React {
Expand All @@ -162,9 +150,8 @@ object Deps {
}

object Log {
const val slf4j = "org.slf4j:slf4j-simple:${Versions.slf4j}"
//const val slf4j = "org.slf4j:slf4j-simple:${Versions.slf4j}"
const val logback = "ch.qos.logback:logback-classic:${Versions.logback}"
const val kermit = "co.touchlab:kermit:${Versions.kermit}"
}

object Glance {
Expand Down
37 changes: 16 additions & 21 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ kotlin {
}
}


applyDefaultHierarchyTemplate()

//macosX64("macOS")
Expand All @@ -60,68 +59,64 @@ kotlin {
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.serialization)

with(Deps.SqlDelight) {
implementation(runtime)
implementation(coroutineExtensions)
}
implementation(libs.sqldelight.runtime)
implementation(libs.sqldelight.coroutines.extensions)

api(libs.koin.core)
implementation(libs.koin.test)

with(Deps.Log) {
api(kermit)
}
api(libs.kermit)
}
}

commonTest {
dependencies {
implementation(libs.koin.test)
implementation(Deps.Kotlinx.coroutinesTest)
implementation(libs.kotlinx.coroutines.test)
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}

androidMain {
dependencies {
implementation(Deps.Ktor.clientAndroid)
implementation(Deps.SqlDelight.androidDriver)
implementation(libs.ktor.client.android)
implementation(libs.sqldelight.android.driver)
}
}

jvmMain {
dependencies {
implementation(Deps.Ktor.clientJava)
implementation(Deps.SqlDelight.sqliteDriver)
implementation(Deps.Log.slf4j)
implementation(libs.ktor.client.java)
implementation(libs.sqldelight.sqlite.driver)
implementation(libs.slf4j)
}
}

iosMain {
dependencies {
implementation(Deps.Ktor.clientDarwin)
implementation(Deps.SqlDelight.nativeDriver)
implementation(libs.ktor.client.darwin)
implementation(libs.sqldelight.native.driver)
}
}

watchosMain {
dependencies {
implementation(Deps.Ktor.clientDarwin)
implementation(Deps.SqlDelight.nativeDriver)
implementation(libs.ktor.client.darwin)
implementation(libs.sqldelight.native.driver)
}
}

macosMain{
dependencies {
implementation(Deps.Ktor.clientDarwin)
implementation(Deps.SqlDelight.nativeDriverMacos)
implementation(libs.ktor.client.darwin)
implementation(libs.sqldelight.native.driver.macos)
}
}

jsMain {
dependencies {
implementation(Deps.Ktor.clientJs)
implementation(libs.ktor.client.js)
}
}

Expand Down
22 changes: 7 additions & 15 deletions compose-ios/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,13 @@ kotlin {
implementation(serializationCore)
}

with(Deps.SqlDelight) {
implementation(runtime)
implementation(coroutineExtensions)
}

with(Deps.Koin) {
api(core)
api(test)
}

with(Deps.Log) {
api(kermit)
}
implementation(libs.sqldelight.runtime)
implementation(libs.sqldelight.coroutines.extensions)

api(libs.koin.core)
implementation(libs.koin.test)

implementation(libs.kermit)

implementation(compose.ui)
implementation(compose.foundation)
Expand All @@ -105,8 +97,8 @@ kotlin {
dependsOn(nativeMain)

dependencies {
implementation(Deps.Ktor.clientDarwin)
implementation(Deps.SqlDelight.nativeDriver)
implementation(libs.ktor.client.darwin)
implementation(libs.sqldelight.native.driver)
}
}
val uikitX64Main by getting {
Expand Down
16 changes: 14 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ coilCompose = "2.4.0"
junit = "4.13.2"

multiplatformSettings = "1.0.0"
kermit = "1.2.2"
kermit = "2.0.2"

gradleVersionsPlugin = "0.39.0"
shadowPlugin = "7.0.0"
Expand Down Expand Up @@ -70,18 +70,30 @@ koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koinCompose" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" }
koin-test-junit4 = { module = "io.insert-koin:koin-test-junit4", version.ref = "koin" }


ktor-client-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
ktor-client-json = { group = "io.ktor", name = "ktor-client-json", version.ref = "ktor" }
ktor-client-logging = { group = "io.ktor", name = "ktor-client-logging", version.ref = "ktor" }
ktor-client-serialization = { group = "io.ktor", name = "ktor-client-serialization", version.ref = "ktor" }
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
ktor-client-android = { group = "io.ktor", name = "ktor-client-android", version.ref = "ktor" }
ktor-client-ios = { group = "io.ktor", name = "ktor-client-ios", version.ref = "ktor" }
ktor-client-darwin = { group = "io.ktor", name = "ktor-client-darwin", version.ref = "ktor" }
ktor-client-java = { group = "io.ktor", name = "ktor-client-java", version.ref = "ktor" }
ktor-client-js = { group = "io.ktor", name = "ktor-client-js", version.ref = "ktor" }

ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
slf4j = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }


sqldelight-runtime = { module = "app.cash.sqldelight:runtime", version.ref = "sqlDelight" }
sqldelight-coroutines-extensions = { module = "app.cash.sqldelight:coroutines-extensions", version.ref = "sqlDelight" }
sqldelight-android-driver = { module = "app.cash.sqldelight:android-driver", version.ref = "sqlDelight" }
sqldelight-native-driver = { module = "app.cash.sqldelight:native-driver", version.ref = "sqlDelight" }
sqldelight-native-driver-macos = { module = "app.cash.sqldelight:native-driver-macosarm64", version.ref = "sqlDelight" }
sqldelight-sqlite-driver = { module = "app.cash.sqldelight:sqlite-driver", version.ref = "sqlDelight" }

multiplatform-settings = { module = "com.russhwolf:multiplatform-settings", version.ref = "multiplatformSettings" }
multiplatform-settings-coroutines = { module = "com.russhwolf:multiplatform-settings-coroutines", version.ref = "multiplatformSettings" }
kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
Expand Down
8 changes: 3 additions & 5 deletions wearApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ dependencies {
}
implementation(libs.androidx.compose.ui.tooling)

with(Deps.Koin) {
implementation(core)
implementation(android)
implementation(compose)
}
implementation(libs.koin.core)
implementation(libs.koin.android)
implementation(libs.koin.androidx.compose)

with (Deps.Ok) {
implementation(okhttp)
Expand Down