Skip to content

Commit 9539af0

Browse files
authored
Ktor 3 + Kotlin 2 (#22)
* Update dependencies * Fix tests * Update Gradle * Update libraries * Update Ktor * Update Plugins * Update Kotlin * Increase version
1 parent 3eecb41 commit 9539af0

File tree

16 files changed

+167
-181
lines changed

16 files changed

+167
-181
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55

66
# Ignore Gradle build output directory
77
build
8+
9+
.kotlin

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
tasks.wrapper {
2-
gradleVersion = "8.8"
2+
gradleVersion = "8.11.1"
33
}
44

55
allprojects {
66

77
group = "com.ucasoft.ktor"
88

9-
version = "0.4.4"
9+
version = "0.50.7"
1010

1111
repositories {
1212
mavenCentral()

buildSrc/src/main/kotlin/Dependensies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import org.gradle.api.Project
22

3-
const val ktorVersion = "2.3.12"
3+
const val ktorVersion = "3.0.1"
44
const val kotestVersion = "5.9.1"
55

66
fun Project.ktor(module: String) = "io.ktor:ktor-$module:$ktorVersion"

gradle/wrapper/gradle-wrapper.jar

130 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

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-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

ktor-simple-cache/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Ktor Simple Cache
22
Base solution which provides the plugin implementation and abstract class for cache providers.
33

4-
[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.ktor/ktor-simple-cache/0.4.4?color=blue)](https://search.maven.org/artifact/com.ucasoft.ktor/ktor-simple-cache/0.4.4/jar)
4+
[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.ktor/ktor-simple-cache/0.50.7?color=blue)](https://search.maven.org/artifact/com.ucasoft.ktor/ktor-simple-cache/0.50.7/jar)
55
## Setup
66
### Gradle
77
```kotlin
88
repositories {
99
mavenCentral()
1010
}
1111

12-
implementation("com.ucasoft.ktor:ktor-simple-cache:0.4.4")
12+
implementation("com.ucasoft.ktor:ktor-simple-cache:0.50.7")
1313
```
1414
## Usage
1515
```kotlin

ktor-simple-cache/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ plugins {
66
}
77

88
kotlin {
9+
jvmToolchain(11)
910
jvm {
10-
jvmToolchain(11)
1111
tasks.withType<Test> {
1212
useJUnitPlatform()
1313
}
@@ -27,7 +27,7 @@ kotlin {
2727
implementation(ktorServer("test-host"))
2828
implementation(kotest("assertions-core"))
2929
implementation(kotestEx("assertions-ktor", "2.0.0"))
30-
implementation("org.mockito.kotlin:mockito-kotlin:5.3.1")
30+
implementation("org.mockito.kotlin:mockito-kotlin:5.4.0")
3131
}
3232
kotlin.srcDir("src/test/kotlin")
3333
}

ktor-simple-cache/src/main/kotlin/com/ucasoft/ktor/simpleCache/CacheOutput.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package com.ucasoft.ktor.simpleCache
22

3-
import io.ktor.server.application.*
43
import io.ktor.server.routing.*
54
import kotlin.time.Duration
65

76
class CacheOutputSelector : RouteSelector() {
87

9-
override fun evaluate(context: RoutingResolveContext, segmentIndex: Int) = RouteSelectorEvaluation.Transparent
8+
override suspend fun evaluate(context: RoutingResolveContext, segmentIndex: Int) = RouteSelectorEvaluation.Transparent
109
}
1110

1211
fun Route.cacheOutput(invalidateAt: Duration? = null, queryKeys: List<String> = emptyList(), build: Route.() -> Unit) : Route {

0 commit comments

Comments
 (0)