From a78ffb794a5a709feaed72e36733514aab467fbe Mon Sep 17 00:00:00 2001 From: Adam <897017+aSemy@users.noreply.github.com> Date: Sun, 1 May 2022 09:41:49 +0200 Subject: [PATCH] implement versions platform, tidy up and bump some dependencies --- gradle/libs.versions.toml | 45 ++++++++++++------- modules/events-server/build.gradle.kts | 6 +-- .../build.gradle.kts | 5 +-- modules/infra-kafka-connect/build.gradle.kts | 8 ++-- modules/kt-rcon/build.gradle.kts | 12 ++--- modules/versions-platform/build.gradle.kts | 41 +++++++++++++++++ modules/web-map/build.gradle.kts | 36 +++++++-------- settings.gradle.kts | 2 + 8 files changed, 101 insertions(+), 54 deletions(-) create mode 100644 modules/versions-platform/build.gradle.kts diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fda7746..c112b5e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,16 +10,24 @@ kotlin = "1.6.21" ## libs ## camel-kafkaConnectors = "0.11.0" -http4k = "4.19.1.0" +http4k = "4.25.12.0" kafka = "3.1.0" -kotlinx-serialization = "1.3.2" kvision = "5.9.0" log4j2 = "2.17.2" qosLogback = "1.2.11" slf4j = "1.7.36" okio = "3.1.0" +scrimage = "4.0.31" + +kotlinx-serialization = "1.3.2" +kxs-yaml = "0.43.0" kotlinJsWrappers = "0.0.1-pre.331-kotlin-1.6.20" +kotlinx-html = "0.7.5" +kotlinx-nodejs = "0.0.7" +kotlinx-coroutines = "1.6.1" + +ktor = "2.0.1" ## test ## @@ -52,20 +60,20 @@ dependencyCheck = { id = "com.github.ben-manes.versions", vers ## kotlin ## kotlin-bom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlin" } -kotlinx-serialization-bom = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-bom", version.ref = "kotlinx-serialization" } -kotlinx-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core" } -kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json" } +kotlinx-serialization-bom = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-bom", version.ref = "kotlinx-serialization" } +kotlinx-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core" } +kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json" } kotlinx-serialization-protobuf = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-protobuf" } -kotlinx-serialization-yaml = { group = "com.charleskorn.kaml", name = "kaml", version = "0.37.0" } +kotlinx-serialization-yaml = { group = "com.charleskorn.kaml", name = "kaml", version.ref = "kxs-yaml" } -kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "1.6.1" } +kotlinx-coroutines-bom = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-bom", version.ref = "kotlinx-coroutines" } +kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core" } -kotlinx-html = { group = "org.jetbrains.kotlinx", name = "kotlinx-html", version = "0.7.5" } -kotlinx-nodejs = { group = "org.jetbrains.kotlinx", name = "kotlinx-nodejs", version = "0.0.7" } - -kotlin-jsWrappers-bom = { group = "org.jetbrains.kotlin-wrappers", name = "kotlin-wrappers-bom", version.ref = "kotlinJsWrappers" } +kotlinx-html = { group = "org.jetbrains.kotlinx", name = "kotlinx-html", version.ref = "kotlinx-html" } +kotlinx-nodejs = { group = "org.jetbrains.kotlinx", name = "kotlinx-nodejs", version.ref = "kotlinx-nodejs" } +kotlin-jsWrappers-bom = { group = "org.jetbrains.kotlin-wrappers", name = "kotlin-wrappers-bom", version.ref = "kotlinJsWrappers" } ## http4k ## http4k-bom = { group = "org.http4k", name = "http4k-bom", version.ref = "http4k" } @@ -81,6 +89,11 @@ http4k-format-yaml = { group = "org.http4k", name = "http4k-format-jackson-y http4k-format-kotlinx = { group = "org.http4k", name = "http4k-format-kotlinx-serialization" } http4k-graphql = { group = "org.http4k", name = "http4k-graphql" } + +## ktor ## +ktor-bom = { group = "io.ktor", name = "ktor-bom", version.ref = "ktor" } + + ### jackson ## #jackson-bom = { group = " com.fasterxml.jackson.module", name = ":jackson-module-kotlin", version = "2.13.+" } #jackson-kotlin = { group = " com.fasterxml.jackson.module", name = ":jackson-module-kotlin", version = "2.13.+" } @@ -106,10 +119,10 @@ kafka-streamsTestUtils = { group = "org.apache.kafka", name = "kafka-streams-tes kafka-kotkaStreams = { group = "com.github.adamko-dev.kotka-streams", name = "kotka-streams", version = "v22.04.24" } -jsoup = { group = "org.jsoup", name = "jsoup", version = "1.14.3" } +jsoup = { group = "org.jsoup", name = "jsoup", version = "1.14.3" } skrapeit = { group = "it.skrape", name = "skrapeit", version = "1.2.0" } -scrimage-core = { group = "com.sksamuel.scrimage", name = "scrimage-core", version = "4.0.31" } +scrimage-core = { group = "com.sksamuel.scrimage", name = "scrimage-core", version.ref = "scrimage" } ## okio ## @@ -125,9 +138,9 @@ mockk = { group = "io.mockk", name = "mockk", version = "1.12.3" } ## junit ## junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" } -junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit" } -junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" } -junit-launcher = { group = "org.junit.platform", name = "junit-platform-launcher", version = "1.7.2" } +junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api" } # version.ref = "junit" } +junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine" } # version.ref = "junit" } +junit-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" } # version = "1.7.2" } ## kotest ## kotest-bom = { group = "io.kotest", name = "kotest-bom", version.ref = "kotest" } diff --git a/modules/events-server/build.gradle.kts b/modules/events-server/build.gradle.kts index eafe6bf..6e7d04c 100644 --- a/modules/events-server/build.gradle.kts +++ b/modules/events-server/build.gradle.kts @@ -18,6 +18,7 @@ val projectId: String by project.extra val kafkaStateDir = layout.projectDirectory.dir("kafka-state") dependencies { + implementation(platform(projects.modules.versionsPlatform)) implementation(libs.kafka.streams) testImplementation(libs.kafka.streamsTestUtils) @@ -26,14 +27,12 @@ dependencies { // implementation("com.ionspin.kotlin:bignum:0.3.3") - implementation(platform(libs.kotlinx.serialization.bom)) implementation(libs.kotlinx.serialization.core) implementation(libs.kotlinx.serialization.json) // implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf") - implementation(libs.kotlinx.coroutines) + implementation(libs.kotlinx.coroutines.core) - implementation(platform(libs.http4k.bom)) implementation(libs.bundles.http4k) implementation(libs.http4k.format.kotlinx) @@ -41,7 +40,6 @@ dependencies { implementation(libs.scrimage.core) - implementation(platform(libs.okio.bom)) implementation(libs.okio.core) implementation(libs.kafka.kotkaStreams) { diff --git a/modules/factorio-mod-portal-client/build.gradle.kts b/modules/factorio-mod-portal-client/build.gradle.kts index 0f3cb8d..3475da0 100644 --- a/modules/factorio-mod-portal-client/build.gradle.kts +++ b/modules/factorio-mod-portal-client/build.gradle.kts @@ -8,16 +8,15 @@ plugins { dependencies { + implementation(platform(projects.modules.versionsPlatform)) implementation(projects.modules.eventsServer) - implementation(platform(libs.kotlinx.serialization.bom)) implementation(libs.kotlinx.serialization.core) implementation(libs.kotlinx.serialization.json) - implementation(libs.kotlinx.coroutines) + implementation(libs.kotlinx.coroutines.core) - implementation(platform(libs.http4k.bom)) implementation(libs.bundles.http4k) implementation(libs.http4k.format.kotlinx) diff --git a/modules/infra-kafka-connect/build.gradle.kts b/modules/infra-kafka-connect/build.gradle.kts index 19ce2fa..69b2970 100644 --- a/modules/infra-kafka-connect/build.gradle.kts +++ b/modules/infra-kafka-connect/build.gradle.kts @@ -23,6 +23,8 @@ fun DependencyHandlerScope.kafkaConnector( } dependencies { + implementation(platform(projects.modules.versionsPlatform)) + kotlin("reflect") kafkaConnector("camel-ahc-ws-kafka-connector") @@ -30,12 +32,10 @@ dependencies { implementation("com.github.adamko-dev:json5-kotlin:2.0.3") - implementation(platform(libs.http4k.bom)) implementation(libs.bundles.http4k) - implementation(platform(libs.kotlinx.serialization.bom)) - implementation("org.jetbrains.kotlinx:kotlinx-serialization-core") - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json") + implementation(libs.kotlinx.serialization.core) + implementation(libs.kotlinx.serialization.json) } // disabled for now... diff --git a/modules/kt-rcon/build.gradle.kts b/modules/kt-rcon/build.gradle.kts index caa6ded..375e7b6 100644 --- a/modules/kt-rcon/build.gradle.kts +++ b/modules/kt-rcon/build.gradle.kts @@ -2,16 +2,10 @@ plugins { dev.adamko.kafkatorio.lang.`kotlin-jvm` } -//group = "${rootProject.group}.server" -//version = rootProject.version -// - dependencies { + implementation(platform(projects.modules.versionsPlatform)) - implementation(enforcedPlatform(libs.kotlinx.serialization.bom)) - - implementation(libs.kotlinx.coroutines) - - implementation("io.ktor:ktor-network:1.6.4") + implementation(libs.kotlinx.coroutines.core) + implementation("io.ktor:ktor-network") } diff --git a/modules/versions-platform/build.gradle.kts b/modules/versions-platform/build.gradle.kts new file mode 100644 index 0000000..bb93f8c --- /dev/null +++ b/modules/versions-platform/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + `java-platform` +} + + +javaPlatform { + allowDependencies() +} + + +dependencies { + api(platform(libs.kotlin.bom)) + api(platform(libs.kotlinx.coroutines.bom)) + api(platform(libs.kotlinx.serialization.bom)) + + api(platform(libs.http4k.bom)) + + api(platform(libs.okio.bom)) + + api(platform(libs.ktor.bom)) + + api(platform(libs.kotest.bom)) + + constraints { + api(libs.skrapeit) + api(libs.kotlinx.serialization.yaml) + + + + + + + + + api(libs.kafka.kotkaStreams) + api(libs.kafka.streams) + api(libs.okio.core) + api(libs.scrimage.core) + api(libs.kafka.streamsTestUtils) + } +} diff --git a/modules/web-map/build.gradle.kts b/modules/web-map/build.gradle.kts index 189500f..5f125d7 100644 --- a/modules/web-map/build.gradle.kts +++ b/modules/web-map/build.gradle.kts @@ -1,4 +1,3 @@ -import dev.adamko.kafkatorio.gradle.yarn import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig @@ -66,15 +65,16 @@ kotlin { kvision("kvision-redux") kvision("kvision-state-flow") - implementation(libs.kotlinx.coroutines) - + implementation(dependencies.platform(libs.kotlinx.coroutines.bom)) implementation(dependencies.platform(libs.kotlin.jsWrappers.bom)) -// implementation(dependencies.platform(npm("follow-redirects", "^1.14.8"))) -// implementation(dependencies.platform(npm("nanoid", "^3.1.31"))) -// implementation(dependencies.platform(npm("minimist", "^1.2.6"))) -// implementation(dependencies.platform(npm("async", "^2.6.4"))) -// implementation(dependencies.platform(npm("node-forge", "^1.3.0"))) + implementation(libs.kotlinx.coroutines.core) + + implementation(dependencies.platform(npm("follow-redirects", "^1.14.8"))) + implementation(dependencies.platform(npm("nanoid", "^3.1.31"))) + implementation(dependencies.platform(npm("minimist", "^1.2.6"))) + implementation(dependencies.platform(npm("async", "^2.6.4"))) + implementation(dependencies.platform(npm("node-forge", "^1.3.0"))) } val webDir = file("src/main/web") @@ -104,13 +104,13 @@ fun KotlinDependencyHandler.kvision( } // https://youtrack.jetbrains.com/issue/KT-42420 -afterEvaluate { - yarn { - resolution("mocha", "9.2.2") - resolution("follow-redirects", "1.14.8") - resolution("nanoid", "3.1.31") - resolution("minimist", "1.2.6") - resolution("async", "2.6.4") - resolution("node-forge", "1.3.0") - } -} +//afterEvaluate { +// yarn { +// resolution("mocha", "9.2.2") +// resolution("follow-redirects", "1.14.8") +// resolution("nanoid", "3.1.31") +// resolution("minimist", "1.2.6") +// resolution("async", "2.6.4") +// resolution("node-forge", "1.3.0") +// } +//} diff --git a/settings.gradle.kts b/settings.gradle.kts index 8d88dea..c67af44 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,6 +16,8 @@ include( ":modules:web-map", ":modules:factorio-mod-portal-client", + + ":modules:versions-platform", ) enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")