Skip to content

Commit b290f07

Browse files
authored
KTOR-8635 Use kotlin.time.Clock instead of kotlinx.datetime.Clock (#4974)
1 parent 0c30d44 commit b290f07

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

gradle/libs.versions.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
kotlin = "2.1.21"
44
kotlinx-html = "0.12.0"
5-
kotlinx-datetime = "0.6.2"
65
kotlinx-io = "0.7.0"
76
coroutines = "1.10.2"
87
atomicfu = "0.27.0"
@@ -125,8 +124,6 @@ kotlinx-serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-seria
125124

126125
kotlinx-html = { module = "org.jetbrains.kotlinx:kotlinx-html", version.ref = "kotlinx-html" }
127126

128-
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
129-
130127
kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version.ref = "kotlinx-io" }
131128

132129
kotlinx-browser = { module = "org.jetbrains.kotlinx:kotlinx-browser", version.ref = "kotlinx-browser" }

kotlin-js-store/yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@
6666
"@jridgewell/resolve-uri" "^3.1.0"
6767
"@jridgewell/sourcemap-codec" "^1.4.14"
6868

69-
"@js-joda/[email protected]":
70-
version "3.2.0"
71-
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273"
72-
integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg==
73-
7469
"@puppeteer/[email protected]":
7570
version "1.8.0"
7671
resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-1.8.0.tgz#fb6ee61de15e7f0e67737aea9f9bab1512dbd7d8"

ktor-server/ktor-server-plugins/ktor-server-default-headers/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
56
import java.time.Year
67

78
description = ""
@@ -11,10 +12,10 @@ plugins {
1112
}
1213

1314
kotlin {
14-
sourceSets {
15-
commonMain.dependencies {
16-
api(libs.kotlinx.datetime)
17-
}
15+
compilerOptions {
16+
// For now set API version 2.1 only for this module
17+
// TODO KTOR-8637: Update API level for the whole project
18+
apiVersion = KotlinVersion.KOTLIN_2_1
1819
}
1920
}
2021

ktor-server/ktor-server-plugins/ktor-server-default-headers/common/src/io/ktor/server/plugins/defaultheaders/DefaultHeaders.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ package io.ktor.server.plugins.defaultheaders
66

77
import io.ktor.http.*
88
import io.ktor.server.application.*
9-
import io.ktor.server.plugins.defaultheaders.DefaultHeadersConfig.*
109
import io.ktor.server.response.*
1110
import io.ktor.util.date.*
1211
import io.ktor.utils.io.*
1312
import kotlinx.atomicfu.atomic
13+
import kotlin.time.ExperimentalTime
1414

1515
/**
1616
* A configuration for the [DefaultHeaders] plugin.
@@ -37,7 +37,8 @@ public class DefaultHeadersConfig {
3737
*
3838
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.plugins.defaultheaders.DefaultHeadersConfig.clock)
3939
*/
40-
public var clock: Clock = Clock { kotlinx.datetime.Clock.System.now().toEpochMilliseconds() }
40+
@OptIn(ExperimentalTime::class)
41+
public var clock: Clock = Clock { kotlin.time.Clock.System.now().toEpochMilliseconds() }
4142

4243
/**
4344
* Utility interface for obtaining timestamp.

0 commit comments

Comments
 (0)