Skip to content

Commit 38bd323

Browse files
committed
Use the newest Kotlin
1 parent f1e4fc6 commit 38bd323

File tree

67 files changed

+187
-2259
lines changed

Some content is hidden

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

67 files changed

+187
-2259
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("kotlinx.team.infra") version "0.4.0-dev-81"
2+
id("kotlinx.team.infra") version "0.4.0-dev-82"
33
kotlin("multiplatform") apply false
44
id("org.jetbrains.kotlinx.kover") version "0.8.0-Beta2"
55
}

core/api/kotlinx-datetime.api

Lines changed: 49 additions & 49 deletions
Large diffs are not rendered by default.

core/api/kotlinx-datetime.klib.api

Lines changed: 47 additions & 47 deletions
Large diffs are not rendered by default.

core/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ kotlin {
188188
commonMain {
189189
dependencies {
190190
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-core:$serializationVersion")
191-
api(project(":fake-kotlinx-time"))
192191
}
193192
}
194193

@@ -223,6 +222,10 @@ kotlin {
223222
}
224223
}
225224
}
225+
226+
compilerOptions {
227+
optIn.add("kotlin.time.ExperimentalTime")
228+
}
226229
}
227230

228231
tasks {

core/common/src/Clock.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
package kotlinx.datetime
99

1010
import kotlin.time.*
11-
import kotlinx.time.Clock
12-
import kotlinx.time.Instant
13-
import kotlinx.time.isDistantFuture
11+
import kotlin.time.Clock
12+
import kotlin.time.Instant
13+
import kotlin.time.isDistantFuture
1414
import kotlin.jvm.JvmMultifileClass
1515
import kotlin.jvm.JvmName
1616
import kotlin.time.Duration.Companion.seconds

core/common/src/DeprecatedClock.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ import kotlin.time.ExperimentalTime
1717
import kotlin.time.TimeSource
1818

1919
/**
20-
* Creates a [kotlinx.time.Clock] (the standard library version of `Clock`) delegating to `this`.
20+
* Creates a [kotlin.time.Clock] (the standard library version of `Clock`) delegating to `this`.
2121
*/
22-
public fun Clock.toStdlibClock(): kotlinx.time.Clock =
22+
public fun Clock.toStdlibClock(): kotlin.time.Clock =
2323
(this as? DateTimeClock)?.clock ?: StdlibClock(this)
2424

2525
/**
2626
* Creates a [kotlinx.datetime.Clock] delegating to the version of `Clock` from the standard library.
2727
*/
28-
public fun kotlinx.time.Clock.toDeprecatedClock(): Clock =
28+
public fun kotlin.time.Clock.toDeprecatedClock(): Clock =
2929
(this as? StdlibClock)?.clock ?: DateTimeClock(this)
3030

31-
private class DateTimeClock(val clock: kotlinx.time.Clock): kotlinx.datetime.Clock {
31+
private class DateTimeClock(val clock: kotlin.time.Clock): kotlinx.datetime.Clock {
3232
override fun now(): Instant = clock.now().toDeprecatedInstant()
3333
}
3434

35-
private class StdlibClock(val clock: Clock): kotlinx.time.Clock {
36-
override fun now(): kotlinx.time.Instant = clock.now().toStdlibInstant()
35+
private class StdlibClock(val clock: Clock): kotlin.time.Clock {
36+
override fun now(): kotlin.time.Instant = clock.now().toStdlibInstant()
3737
}
3838

3939
/**
@@ -48,7 +48,7 @@ private class StdlibClock(val clock: Clock): kotlinx.time.Clock {
4848
*/
4949
@Deprecated(
5050
"Use kotlin.time.Clock instead",
51-
ReplaceWith("kotlinx.time.Clock", "kotlinx.time.Clock"),
51+
ReplaceWith("kotlin.time.Clock", "kotlin.time.Clock"),
5252
level = DeprecationLevel.WARNING
5353
)
5454
public interface Clock {
@@ -85,7 +85,7 @@ public interface Clock {
8585
* @sample kotlinx.datetime.test.samples.ClockSamples.dependencyInjection
8686
*/
8787
public object System : Clock {
88-
override fun now(): Instant = kotlinx.time.Clock.System.now().toDeprecatedInstant()
88+
override fun now(): Instant = kotlin.time.Clock.System.now().toDeprecatedInstant()
8989
}
9090

9191
/** A companion object used purely for namespacing. */

core/common/src/DeprecatedInstant.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ import kotlin.time.Duration
2222
import kotlin.time.TimeSource
2323

2424
/**
25-
* Creates a [kotlinx.time.Instant] (the standard library version of `Instant`) identical to `this`.
25+
* Creates a [kotlin.time.Instant] (the standard library version of `Instant`) identical to `this`.
2626
*/
27-
public fun Instant.toStdlibInstant(): kotlinx.time.Instant =
28-
kotlinx.time.Instant.fromEpochSeconds(epochSeconds, nanosecondsOfSecond)
27+
public fun Instant.toStdlibInstant(): kotlin.time.Instant =
28+
kotlin.time.Instant.fromEpochSeconds(epochSeconds, nanosecondsOfSecond)
2929

3030
/**
3131
* Creates a [kotlinx.datetime.Instant] identical to the version of `Instant` from the standard library.
3232
*/
33-
public fun kotlinx.time.Instant.toDeprecatedInstant(): Instant =
33+
public fun kotlin.time.Instant.toDeprecatedInstant(): Instant =
3434
Instant.fromEpochSeconds(epochSeconds, nanosecondsOfSecond)
3535

3636
@Deprecated(
3737
"Use kotlin.time.Instant instead",
38-
ReplaceWith("kotlinx.time.Instant", "kotlinx.time.Instant"),
38+
ReplaceWith("kotlin.time.Instant", "kotlin.time.Instant"),
3939
level = DeprecationLevel.WARNING
4040
)
4141
@Serializable(with = InstantIso8601Serializer::class)
@@ -191,7 +191,7 @@ public expect class Instant : Comparable<Instant> {
191191

192192

193193
public companion object {
194-
@Deprecated("Use Clock.System.now() instead", ReplaceWith("Clock.System.now()", "kotlinx.time.Clock"), level = DeprecationLevel.ERROR)
194+
@Deprecated("Use Clock.System.now() instead", ReplaceWith("Clock.System.now()", "kotlin.time.Clock"), level = DeprecationLevel.ERROR)
195195
public fun now(): Instant
196196

197197
/**
@@ -294,7 +294,7 @@ public expect class Instant : Comparable<Instant> {
294294
*/
295295
@Deprecated("kotlinx.datetime.Instant is superseded by kotlin.time.Instant",
296296
level = DeprecationLevel.WARNING,
297-
replaceWith = ReplaceWith("this.toStdlibInstant().isDistantPast", "kotlinx.time.isDistantPast")
297+
replaceWith = ReplaceWith("this.toStdlibInstant().isDistantPast", "kotlin.time.isDistantPast")
298298
)
299299
public val Instant.isDistantPast: Boolean
300300
get() = this <= Instant.DISTANT_PAST
@@ -306,7 +306,7 @@ public val Instant.isDistantPast: Boolean
306306
*/
307307
@Deprecated("kotlinx.datetime.Instant is superseded by kotlin.time.Instant",
308308
level = DeprecationLevel.WARNING,
309-
replaceWith = ReplaceWith("this.toStdlibInstant().isDistantPast", "kotlinx.time.isDistantFuture")
309+
replaceWith = ReplaceWith("this.toStdlibInstant().isDistantPast", "kotlin.time.isDistantFuture")
310310
)
311311
public val Instant.isDistantFuture: Boolean
312312
get() = this >= Instant.DISTANT_FUTURE

core/common/src/Instant.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package kotlinx.datetime
1010
import kotlinx.datetime.format.*
1111
import kotlinx.datetime.internal.*
1212
import kotlin.time.*
13-
import kotlinx.time.Instant
13+
import kotlin.time.Instant
1414
import kotlin.jvm.JvmMultifileClass
1515
import kotlin.jvm.JvmName
1616

core/common/src/TimeZone.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package kotlinx.datetime
1010

1111
import kotlinx.datetime.serializers.*
1212
import kotlinx.serialization.Serializable
13-
import kotlinx.time.Instant
13+
import kotlin.time.Instant
1414

1515
/**
1616
* A time zone, provides the conversion between [Instant] and [LocalDateTime] values

core/common/src/format/DateTimeComponents.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import kotlinx.datetime.internal.format.*
1212
import kotlinx.datetime.internal.format.parser.Copyable
1313
import kotlinx.datetime.internal.safeMultiply
1414
import kotlin.reflect.*
15-
import kotlinx.time.Instant
15+
import kotlin.time.Instant
1616

1717
/**
1818
* A collection of datetime fields used specifically for parsing and formatting.

0 commit comments

Comments
 (0)