Skip to content

Commit 22a19af

Browse files
committed
update samples for 3.0.0
1 parent 35ff16e commit 22a19af

File tree

44 files changed

+261
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+261
-148
lines changed

build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ plugins {
2525
}
2626

2727
subprojects {
28-
// Regular java modules need 'java-library' plugin for proper publication
29-
// apply(plugin = "java-library")
3028
when {
3129
(isJpms == true || name == "kotysa-java-tests") -> apply(plugin = "kotysa.jpms-no-mobile-conventions")
3230
isJpms == false -> apply(plugin = "kotysa.client-only-conventions")

samples/kotysa-ktor-jdbc/build.gradle

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ plugins {
66

77
mainClassName = "com.sample.ApplicationKt"
88

9+
java {
10+
toolchain {
11+
languageVersion.set(JavaLanguageVersion.of(11))
12+
}
13+
}
14+
915
repositories {
1016
mavenCentral()
1117
}
@@ -29,11 +35,24 @@ dependencies {
2935
testImplementation("io.kotest.extensions:kotest-assertions-ktor:$kotest_assertions_ktor_version")
3036
}
3137

38+
compileJava {
39+
// replace '-' with '.' to match JPMS jigsaw module name
40+
def jpmsName = project.name.replace('-', '.')
41+
// this is needed because we have a separate compile step in this example with th
42+
// 'module-info.java' is in 'main/java' and the Kotlin code is in 'main/kotlin'
43+
options.compilerArgs = [
44+
// "--module-path",
45+
// compileJava.classpath.asPath,
46+
"--patch-module",
47+
"$jpmsName=${sourceSets.main.output.asPath}"
48+
]
49+
}
50+
3251
test {
3352
useJUnitPlatform()
3453
}
3554

3655
wrapper {
37-
gradleVersion = '7.6'
56+
gradleVersion = '8.1'
3857
distributionType = Wrapper.DistributionType.ALL
3958
}

samples/kotysa-ktor-jdbc/gradle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ version=0.1
33

44
# plugins
55
# https://kotlinlang.org/docs/releases.html#release-details
6-
kotlin_version=1.7.21
6+
kotlin_version=1.8.20
77

88
# main
99
# https://github.com/ktorio/ktor/releases
10-
ktor_version=2.2.3
10+
ktor_version=2.2.4
1111
# https://mvnrepository.com/artifact/ch.qos.logback/logback-core
12-
logback_version=1.4.5
12+
logback_version=1.4.6
1313
# https://mvnrepository.com/artifact/com.h2database/h2
1414
h2_version=2.1.214
1515
# https://mvnrepository.com/artifact/org.kodein.di/kodein-di-framework-ktor-server-jvm
16-
kodein_di_ktor_version=7.18.0
16+
kodein_di_ktor_version=7.20.1
1717
# https://github.com/Kotlin/kotlinx-datetime/releases
1818
kotlinx_datetime_version=0.4.0
1919
# https://github.com/ufoss-org/kotysa/releases
20-
kotysa_version=2.4.0
20+
kotysa_version=3.0.0
2121

2222
#tests
2323
# https://github.com/kotest/kotest/releases
24-
kotest_version=5.5.5
24+
kotest_version=5.6.0
2525
# https://github.com/kotest/kotest-assertions-ktor
26-
kotest_assertions_ktor_version=1.0.3
26+
kotest_assertions_ktor_version=2.0.0
2727

2828
kotlin.code.style=official
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module kotysa.ktor.jdbc {
2+
requires java.sql;
3+
requires com.h2database;
4+
requires io.ktor.server.core;
5+
requires io.ktor.server.host.common;
6+
requires io.ktor.server.netty;
7+
requires kotlin.stdlib;
8+
requires kotysa.jdbc;
9+
10+
exports com.sample;
11+
}

samples/kotysa-ktor-r2dbc-coroutines/build.gradle

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ plugins {
44
id 'org.jetbrains.kotlin.plugin.serialization'
55
}
66

7-
mainClassName = "com.sample.ApplicationKt"
7+
java {
8+
toolchain {
9+
languageVersion.set(JavaLanguageVersion.of(11))
10+
}
11+
}
812

913
repositories {
1014
mavenCentral()
@@ -19,7 +23,7 @@ dependencies {
1923
implementation("ch.qos.logback:logback-classic:$logback_version")
2024
implementation("org.kodein.di:kodein-di-framework-ktor-server-jvm:$kodein_di_ktor_version") // kodein for ktor
2125
implementation("org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version")
22-
implementation("org.ufoss.kotysa:kotysa-r2dbc-coroutines:$kotysa_version")
26+
implementation("org.ufoss.kotysa:kotysa-r2dbc:$kotysa_version")
2327

2428
runtimeOnly("io.r2dbc:r2dbc-h2:$h2_version") // R2DBC driver for H2
2529

@@ -30,24 +34,24 @@ dependencies {
3034
testImplementation("io.kotest.extensions:kotest-assertions-ktor:$kotest_assertions_ktor_version")
3135
}
3236

33-
compileKotlin {
34-
kotlinOptions {
35-
freeCompilerArgs = ['-opt-in=kotlinx.serialization.ExperimentalSerializationApi', '-opt-in=kotlin.RequiresOptIn']
36-
}
37-
}
38-
39-
compileTestKotlin {
40-
kotlinOptions {
41-
freeCompilerArgs = ['-opt-in=kotlin.RequiresOptIn', '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
42-
'-opt-in=kotlinx.serialization.ExperimentalSerializationApi']
43-
}
37+
compileJava {
38+
// replace '-' with '.' to match JPMS jigsaw module name
39+
def jpmsName = project.name.replace('-', '.')
40+
// this is needed because we have a separate compile step in this example with th
41+
// 'module-info.java' is in 'main/java' and the Kotlin code is in 'main/kotlin'
42+
options.compilerArgs = [
43+
// "--module-path",
44+
// compileJava.classpath.asPath,
45+
"--patch-module",
46+
"$jpmsName=${sourceSets.main.output.asPath}"
47+
]
4448
}
4549

4650
test {
4751
useJUnitPlatform()
4852
}
4953

5054
wrapper {
51-
gradleVersion = '7.6'
55+
gradleVersion = '8.1'
5256
distributionType = Wrapper.DistributionType.ALL
5357
}

samples/kotysa-ktor-r2dbc-coroutines/gradle.properties

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ version=0.1
33

44
# plugins
55
# https://kotlinlang.org/docs/releases.html#release-details
6-
kotlin_version=1.7.21
6+
kotlin_version=1.8.20
77

88
# main
99
# https://github.com/ktorio/ktor/releases
10-
ktor_version=2.2.3
10+
ktor_version=2.2.4
1111
# https://mvnrepository.com/artifact/ch.qos.logback/logback-core
12-
logback_version=1.4.5
12+
logback_version=1.4.6
1313
# https://search.maven.org/artifact/io.r2dbc/r2dbc-h2
14-
h2_version=0.9.1.RELEASE
14+
h2_version=1.0.0.RELEASE
1515
# https://mvnrepository.com/artifact/org.kodein.di/kodein-di-framework-ktor-server-jvm
16-
kodein_di_ktor_version=7.18.0
16+
kodein_di_ktor_version=7.20.1
1717
# https://github.com/Kotlin/kotlinx-datetime/releases
1818
kotlinx_datetime_version=0.4.0
1919
# https://github.com/ufoss-org/kotysa/releases
20-
kotysa_version=2.4.0
20+
kotysa_version=3.0.0
2121

2222
# tests
2323
# https://github.com/kotest/kotest/releases
24-
kotest_version=5.5.5
24+
kotest_version=5.6.0
2525
# https://github.com/kotest/kotest-assertions-ktor
26-
kotest_assertions_ktor_version=1.0.3
26+
kotest_assertions_ktor_version=2.0.0
2727

2828
kotlin.code.style=official
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

samples/kotysa-ktor-r2dbc-coroutines/gradlew

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144141
case $MAX_FD in #(
145142
max*)
146143
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
144+
# shellcheck disable=SC3045
148145
MAX_FD=$( ulimit -H -n ) ||
149146
warn "Could not query maximum file descriptor limit"
150147
esac
151148
case $MAX_FD in #(
152149
'' | soft) :;; #(
153150
*)
154151
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
152+
# shellcheck disable=SC3045
156153
ulimit -n "$MAX_FD" ||
157154
warn "Could not set maximum file descriptor limit to $MAX_FD"
158155
esac
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
197194
done
198195
fi
199196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
200201
# Collect all arguments for the java command;
201202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202203
# shell script including quotes and variable substitutions, so put them in

0 commit comments

Comments
 (0)