Skip to content

Upgrade kotlinx-datetime to 0.7.1 #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ kotlin {
all {
languageSettings {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
optIn("kotlin.time.ExperimentalTime")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import com.powersync.attachments.AttachmentContext
import com.powersync.attachments.AttachmentState
import com.powersync.db.getString
import com.powersync.db.internal.ConnectionContext
import kotlinx.datetime.Clock
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import kotlin.time.Clock

/**
* Default implementation of [AttachmentContext].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.datetime.Instant
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toInstant
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Instant

/**
* A PowerSync managed database.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.powersync.sync

import com.powersync.bucket.BucketPriority
import kotlinx.datetime.Instant
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand All @@ -16,6 +15,7 @@ import kotlinx.serialization.encoding.decodeStructure
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.serializer
import kotlin.time.Instant

/**
* An instruction sent to this SDK by the core extension to implement sync behavior.
Expand Down
4 changes: 2 additions & 2 deletions core/src/commonMain/kotlin/com/powersync/sync/SyncStatus.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.powersync.connectors.PowerSyncBackendConnector
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import kotlin.time.Clock
import kotlin.time.Instant

@ConsistentCopyVisibility
public data class PriorityStatusEntry internal constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ import kotlinx.coroutines.flow.emitAll
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlinx.datetime.Clock
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.encodeToJsonElement
import kotlin.time.Clock

@OptIn(ExperimentalPowerSyncAPI::class)
internal class SyncStream(
Expand Down
8 changes: 8 additions & 0 deletions demos/android-supabase-todolist/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ android {
}
}

kotlin {
sourceSets.all {
languageSettings {
optIn("kotlin.time.ExperimentalTime")
}
}
}

dependencies {
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.core.ktx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.launch
import kotlinx.datetime.Clock
import kotlin.time.Clock

internal class Todo(
private val db: PowerSyncDatabase,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.powersync.demos

import kotlinx.datetime.Clock
import kotlin.random.Random

fun generateRandomPerson(): Pair<String, String> {
Expand Down
6 changes: 6 additions & 0 deletions demos/supabase-todolist/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ kotlin {
}
}
sourceSets {
all {
languageSettings {
optIn("kotlin.time.ExperimentalTime")
}
}

commonMain.dependencies {
// Need to use api here otherwise Database driver can't be accessed
// When copying this example, replace "latest.release" with the current version available
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import kotlinx.datetime.Clock
import kotlin.time.Clock

internal class Todo(
private val db: PowerSyncDatabase,
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ idea = "243.22562.218" # Meerkat | 2024.3.1 (see https://plugins.jetbrains.com/d
kermit = "2.0.5"
kotlin = "2.1.21"
coroutines = "1.8.1"
kotlinx-datetime = "0.6.2"
kotlinx-datetime = "0.7.1"
kotlinx-io = "0.5.4"
ktor = "3.1.0"
rsocket = "0.20.0"
Expand Down