From 4a63d2b3279c40acb64d1e8d1dfeed557cf9ac15 Mon Sep 17 00:00:00 2001 From: Anthony Berg Date: Sun, 5 May 2024 16:35:43 +0100 Subject: [PATCH] build(connector): move implementation to libs.versions.toml --- connector/composeApp/build.gradle.kts | 66 ++++++++------------------- connector/gradle/libs.versions.toml | 48 +++++++++++++++++-- connector/server/build.gradle.kts | 7 ++- connector/shared/build.gradle.kts | 41 ++++++----------- 4 files changed, 81 insertions(+), 81 deletions(-) diff --git a/connector/composeApp/build.gradle.kts b/connector/composeApp/build.gradle.kts index 4d234ff..353f294 100644 --- a/connector/composeApp/build.gradle.kts +++ b/connector/composeApp/build.gradle.kts @@ -6,17 +6,6 @@ plugins { alias(libs.plugins.jetbrainsCompose) } -val material3Version = "1.6.1" -val voyagerVersion = "1.0.0" -val kotlinxVersion = "1.8.0" -val koinVersion = "3.5.3" -val kodeinVersion = "7.21.2" -val kotlinLogging = "5.1.0" -val sl4jVersion = "2.0.13" - -// Testing Versions -val jupyterVersion = "5.10.1" - kotlin { jvm("desktop") jvmToolchain(21) @@ -28,6 +17,7 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) + implementation(compose.material3) implementation(compose.ui) implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) @@ -35,40 +25,24 @@ kotlin { } desktopMain.dependencies { implementation(compose.desktop.currentOs) - implementation("org.jetbrains.compose.material3:material3-desktop:$material3Version") + implementation(libs.kotlinx.coroutines.swing) - // Koin - implementation(project.dependencies.platform("io.insert-koin:koin-bom:$koinVersion")) - implementation("io.insert-koin:koin-core:$koinVersion") - implementation("io.insert-koin:koin-compose:1.1.2") + //Koin + implementation(libs.koin.core) + implementation(project.dependencies.platform(libs.koin.bom)) + implementation(libs.koin.compose) - // Voyager - Navigation - // Multiplatform + // Voyager + implementation(libs.voyager.navigator) + implementation(libs.voyager.screenmodel) + implementation(libs.voyager.bottom.sheet.navigator) + implementation(libs.voyager.tab.navigator) + implementation(libs.voyager.transitions) + implementation(libs.voyager.koin) - // Navigator - implementation("cafe.adriel.voyager:voyager-navigator:$voyagerVersion") - - // Screen Model - implementation("cafe.adriel.voyager:voyager-screenmodel:$voyagerVersion") - - // BottomSheetNavigator - implementation("cafe.adriel.voyager:voyager-bottom-sheet-navigator:$voyagerVersion") - - // TabNavigator - implementation("cafe.adriel.voyager:voyager-tab-navigator:$voyagerVersion") - - // Transitions - implementation("cafe.adriel.voyager:voyager-transitions:$voyagerVersion") - - // Koin integration - implementation("cafe.adriel.voyager:voyager-koin:$voyagerVersion") - - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:$kotlinxVersion") - - // Kotlin Logging - implementation("io.github.oshai:kotlin-logging-jvm:$kotlinLogging") - implementation("org.slf4j:slf4j-api:$sl4jVersion") - implementation("org.slf4j:slf4j-reload4j:$sl4jVersion") + implementation(libs.kotlin.logging.jvm) + implementation(libs.slf4j.api) + implementation(libs.slf4j.reload4j) } // Testing @@ -78,15 +52,13 @@ kotlin { @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(compose.uiTest) - - implementation("org.junit.jupiter:junit-jupiter:$jupyterVersion") + implementation(libs.junit.api) } desktopTest.dependencies { implementation(compose.desktop.uiTestJUnit4) implementation(compose.desktop.currentOs) - - implementation("org.junit.jupiter:junit-jupiter:$jupyterVersion") - implementation("io.insert-koin:koin-test:$koinVersion") + implementation(libs.junit.api) + implementation(libs.koin.test) } } } diff --git a/connector/gradle/libs.versions.toml b/connector/gradle/libs.versions.toml index 64b47d3..273c5b1 100644 --- a/connector/gradle/libs.versions.toml +++ b/connector/gradle/libs.versions.toml @@ -1,24 +1,66 @@ [versions] compose = "1.6.7" compose-plugin = "1.6.2" -junit = "4.13.2" +datetime = "0.5.0" +junit = "5.10.2" +koin = "3.5.6" +koin-compose = "1.1.5" kotlin = "1.9.23" +kotlinx = "1.8.0" +kotlinLogging = "6.0.9" ktor = "2.3.10" logback = "1.5.6" +slf4j = "2.0.13" +sqldelight = "2.0.2" +vdmj = "4.5.0" +voyager = "1.0.0" +xpc = "1.4.0-SNAPSHOT" [libraries] kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } -junit = { group = "junit", name = "junit", version.ref = "junit" } +junit-api = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" } compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } + +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx" } +kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx" } +kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" } + +ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } +ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } +ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } ktor-server-core = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" } ktor-server-netty = { module = "io.ktor:ktor-server-netty-jvm", version.ref = "ktor" } ktor-server-tests = { module = "io.ktor:ktor-server-tests-jvm", version.ref = "ktor" } +ktor-server-content-negotiation = { module = "io.ktor:ktor-server-content-negotiation-jvm", version.ref = "ktor"} + +sqldelight-driver = { module = "app.cash.sqldelight:sqlite-driver", version.ref = "sqldelight" } +sqldelight-coroutines-extensions = { module = "app.cash.sqldelight:coroutines-extensions", version.ref = "sqldelight" } + +vdmj = { module = "dk.au.ece.vdmj:vdmj", version.ref = "vdmj" } +xpc = { module = "gov.nasa.xpc:xpc", version.ref = "xpc" } + +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +slf4j-reload4j = { module = "org.slf4j:slf4j-reload4j", version.ref = "slf4j" } +kotlin-logging-jvm = { module = "io.github.oshai:kotlin-logging-jvm", version.ref = "kotlinLogging" } + +koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } +koin-bom = { module = "io.insert-koin:koin-bom", version.ref = "koin" } +koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin-compose" } +koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" } + +voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" } +voyager-screenmodel = { module = "cafe.adriel.voyager:voyager-screenmodel", version.ref = "voyager" } +voyager-bottom-sheet-navigator = { module = "cafe.adriel.voyager:voyager-bottom-sheet-navigator", version.ref = "voyager" } +voyager-tab-navigator = { module = "cafe.adriel.voyager:voyager-tab-navigator", version.ref = "voyager" } +voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager" } +voyager-koin = { module = "cafe.adriel.voyager:voyager-koin", version.ref = "voyager" } [plugins] jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } ktor = { id = "io.ktor.plugin", version.ref = "ktor" } -kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } \ No newline at end of file +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } diff --git a/connector/server/build.gradle.kts b/connector/server/build.gradle.kts index 1887b0a..55c08fb 100644 --- a/connector/server/build.gradle.kts +++ b/connector/server/build.gradle.kts @@ -2,10 +2,9 @@ plugins { alias(libs.plugins.kotlinJvm) alias(libs.plugins.ktor) application - id("org.jetbrains.kotlin.plugin.serialization") version "1.9.23" + kotlin("plugin.serialization") version libs.versions.kotlin } -val sl4jVersion = "2.0.12" group = "io.anthonyberg.connector" version = "1.0.0" @@ -22,6 +21,6 @@ dependencies { testImplementation(libs.ktor.server.tests) testImplementation(libs.kotlin.test.junit) - implementation("io.ktor:ktor-server-content-negotiation-jvm") - implementation("io.ktor:ktor-serialization-kotlinx-json-jvm") + implementation(libs.ktor.server.content.negotiation) + implementation(libs.ktor.serialization.kotlinx.json) } diff --git a/connector/shared/build.gradle.kts b/connector/shared/build.gradle.kts index 83b03cf..effd24f 100644 --- a/connector/shared/build.gradle.kts +++ b/connector/shared/build.gradle.kts @@ -1,20 +1,10 @@ plugins { alias(libs.plugins.kotlinMultiplatform) - kotlin("plugin.serialization") version "1.9.23" - id("app.cash.sqldelight") version "2.0.2" + kotlin("plugin.serialization") version libs.versions.kotlin + alias(libs.plugins.sqldelight) } -val coroutinesVersion = "1.8.0" -val ktorVersion = "2.3.9" -val sqlDelightVersion = "2.0.2" -val dateTimeVersion = "0.5.0" -val sl4jVersion = "2.0.13" -val vdmjVersion = "4.5.0" - -// Testing Dependencies -val jupyterVersion = "5.10.1" - kotlin { jvm() jvmToolchain(21) @@ -22,25 +12,22 @@ kotlin { sourceSets { commonMain.dependencies { // put your Multiplatform dependencies here - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") - implementation("io.ktor:ktor-client-core:$ktorVersion") - implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion") - implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion") - implementation("app.cash.sqldelight:sqlite-driver:$sqlDelightVersion") - implementation("app.cash.sqldelight:coroutines-extensions:$sqlDelightVersion") - implementation("org.jetbrains.kotlinx:kotlinx-datetime:$dateTimeVersion") - implementation("org.slf4j:slf4j-api:$sl4jVersion") - implementation("org.slf4j:slf4j-reload4j:$sl4jVersion") - - implementation("dk.au.ece.vdmj:vdmj:$vdmjVersion") - - // this feels like the most godawful hack I have created, I am ashamed - implementation("gov.nasa.xpc:xpc:1.4.0-SNAPSHOT") + implementation(libs.kotlinx.coroutines.core) + implementation(libs.ktor.client.core) + implementation(libs.ktor.client.content.negotiation) + implementation(libs.ktor.serialization.kotlinx.json) + implementation(libs.sqldelight.driver) + implementation(libs.sqldelight.coroutines.extensions) + implementation(libs.kotlinx.datetime) + implementation(libs.slf4j.api) + implementation(libs.slf4j.reload4j) + implementation(libs.vdmj) + implementation(libs.xpc) } commonTest.dependencies { implementation(libs.kotlin.test) - implementation("org.junit.jupiter:junit-jupiter:$jupyterVersion") + implementation(libs.junit.api) } } }