Browse Source

fixed older variants

Ilya Nemtsev 7 months ago
parent
commit
981a75bd69

+ 10 - 5
frameworks/Kotlin/ktor/ktor-asyncdb/build.gradle.kts

@@ -1,6 +1,6 @@
 plugins {
     application
-    kotlin("jvm") version "1.9.22"
+    kotlin("jvm") version "2.0.21"
     kotlin("plugin.serialization") version "2.0.0"
     id("com.github.johnrengelman.shadow") version "8.1.0"
 }
@@ -17,8 +17,7 @@ application {
 }
 
 val ktor_version = "2.3.12"
-val kotlinx_serialization_version = "1.6.3"
-val vertx_pg_client = "4.5.8"
+val kotlinx_serialization_version = "1.7.3"
 
 dependencies {
     implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinx_serialization_version")
@@ -26,11 +25,17 @@ dependencies {
     implementation("io.ktor:ktor-server-netty:$ktor_version")
     implementation("io.ktor:ktor-server-default-headers:$ktor_version")
     implementation("io.ktor:ktor-server-html-builder:$ktor_version")
-    implementation("com.github.jasync-sql:jasync-postgresql:2.2.0")
+    implementation("com.github.jasync-sql:jasync-postgresql:2.2.4")
+}
+
+java {
+    toolchain {
+        languageVersion = JavaLanguageVersion.of(21)
+    }
 }
 
 tasks.shadowJar {
-    archiveBaseName.set("bench")
+    archiveBaseName.set("ktor-asyncdb")
     archiveClassifier.set("")
     archiveVersion.set("")
 }

+ 1 - 1
frameworks/Kotlin/ktor/ktor-asyncdb/gradle.properties

@@ -1,4 +1,4 @@
 kotlin.code.style=official
 
-kotlin_version=1.9.22
+kotlin_version=2.0.21
 ktor_version=2.3.12

+ 0 - 1
frameworks/Kotlin/ktor/ktor-asyncdb/gradle/wrapper/gradle-wrapper.properties

@@ -1,4 +1,3 @@
-#Fri Dec 07 21:01:17 MST 2018
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME

+ 0 - 14
frameworks/Kotlin/ktor/ktor-asyncdb/settings.gradle

@@ -1,14 +0,0 @@
-pluginManagement {
-    resolutionStrategy {
-        eachPlugin {
-            if (requested.id.id == "org.jetbrains.kotlin.jvm") {
-                useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
-            }
-            if (requested.id.id == "kotlinx-serialization") {
-                useModule("org.jetbrains.kotlin:kotlin-serialization:$kotlin_version")
-            }
-        }
-    }
-}
-
-rootProject.name = 'tech-empower-framework-benchmark'

+ 1 - 0
frameworks/Kotlin/ktor/ktor-asyncdb/settings.gradle.kts

@@ -0,0 +1 @@
+rootProject.name = "tech-empower-framework-benchmark"

+ 11 - 6
frameworks/Kotlin/ktor/ktor-jasync.dockerfile

@@ -1,10 +1,15 @@
-FROM gradle:jdk21
+FROM gradle:jdk21 as build
+WORKDIR /app
+COPY ktor-asyncdb/gradle gradle
+COPY ktor-asyncdb/build.gradle.kts build.gradle.kts
+COPY ktor-asyncdb/gradlew gradlew
+COPY ktor-asyncdb/src src
+RUN /app/gradlew --no-daemon shadowJar
 
-WORKDIR /ktor-asyncdb
-COPY ktor-asyncdb/settings.gradle settings.gradle
-COPY ktor-asyncdb/app app
-RUN gradle --no-daemon shadowJar
+FROM amazoncorretto:21-al2023-headless
+WORKDIR /app
+COPY --from=build /app/build/libs/ktor-asyncdb.jar ktor-asyncdb.jar
 
 EXPOSE 9090
 
-CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AlwaysPreTouch", "/app/build/libs/bench.jar", "jasync-sql"]
+CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AlwaysPreTouch", "-jar", "ktor-asyncdb.jar", "jasync-sql"]

+ 10 - 7
frameworks/Kotlin/ktor/ktor-pgclient/build.gradle.kts

@@ -1,6 +1,6 @@
 plugins {
     application
-    kotlin("jvm") version "1.9.22"
+    kotlin("jvm") version "2.0.21"
     kotlin("plugin.serialization") version "2.0.0"
     id("com.github.johnrengelman.shadow") version "8.1.0"
 }
@@ -17,19 +17,22 @@ application {
 }
 
 val ktor_version = "2.3.12"
+val vertx_version = "4.5.11"
 
 dependencies {
-    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
+    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
     implementation("io.ktor:ktor-server-netty:$ktor_version")
     implementation("io.ktor:ktor-server-html-builder-jvm:$ktor_version")
     implementation("io.ktor:ktor-server-default-headers-jvm:$ktor_version")
-    implementation("io.vertx:vertx-pg-client:4.5.8")
-    implementation("io.vertx:vertx-lang-kotlin:4.5.8")
-    implementation("io.vertx:vertx-lang-kotlin-coroutines:4.5.8")
+    implementation("io.vertx:vertx-pg-client:$vertx_version")
+    implementation("io.vertx:vertx-lang-kotlin:$vertx_version")
+    implementation("io.vertx:vertx-lang-kotlin-coroutines:$vertx_version")
 }
 
-tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
-    kotlinOptions.jvmTarget = "21"
+java {
+    toolchain {
+        languageVersion = JavaLanguageVersion.of(21)
+    }
 }
 
 tasks.shadowJar {