Skip to content

Commit 880b0bf

Browse files
authored
Update dependencies (#234)
1 parent c1bb07a commit 880b0bf

File tree

16 files changed

+69
-84
lines changed

16 files changed

+69
-84
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Android: Ensure JNI libraries are 16KB-aligned.
77
* Support receiving binary sync lines over HTTP when the Rust client is enabled.
88
* Remove the experimental websocket transport mode.
9+
* Update to Kotlin 2.2.0.
10+
* Migrate to `kotlin.time` APIs where appropriate.
911

1012
## 1.3.0
1113

PowerSyncKotlin/build.gradle.kts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,6 @@ kotlin {
5050
}
5151
}
5252

53-
repositories {
54-
maven {
55-
name = "PowerSyncSQLiterFork"
56-
url = uri("https://powersync-ja.github.io/SQLiter")
57-
content {
58-
includeModuleByRegex("co.touchlab", "sqliter-driver.*")
59-
}
60-
}
61-
}
62-
63-
configurations.all {
64-
resolutionStrategy {
65-
// This version has not been released yet (https://github.com/touchlab/SQLiter/pull/124), so we're pointing this
66-
// towards our fork with the repositories block above.
67-
// The API is identical, but we have to make sure this particular project builds the xcframework with the
68-
// patched SQLiter version to avoid linker errors on macOS.
69-
force("co.touchlab:sqliter-driver:1.3.2-powersync")
70-
}
71-
}
72-
7353
listOf("Debug", "Release").forEach { buildType ->
7454
tasks.register<Exec>("build$buildType") {
7555
group = "build"

core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ kotlin {
181181
all {
182182
languageSettings {
183183
optIn("kotlinx.cinterop.ExperimentalForeignApi")
184+
optIn("kotlin.time.ExperimentalTime")
184185
}
185186
}
186187

core/src/commonMain/kotlin/com/powersync/attachments/AttachmentQueue.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,7 @@ public open class AttachmentQueue(
359359
metaData = item.metaData,
360360
),
361361
)
362-
} else if
363-
(existingQueueItem.state == AttachmentState.ARCHIVED) {
362+
} else if (existingQueueItem.state == AttachmentState.ARCHIVED) {
364363
// The attachment is present again. Need to queue it for sync.
365364
// We might be able to optimize this in future.
366365
if (existingQueueItem.hasSynced) {

core/src/commonMain/kotlin/com/powersync/attachments/implementation/AttachmentContextImpl.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import com.powersync.attachments.AttachmentContext
77
import com.powersync.attachments.AttachmentState
88
import com.powersync.db.getString
99
import com.powersync.db.internal.ConnectionContext
10-
import kotlinx.datetime.Clock
11-
import kotlinx.serialization.encodeToString
1210
import kotlinx.serialization.json.Json
11+
import kotlin.time.Clock
1312

1413
/**
1514
* Default implementation of [AttachmentContext].

core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ import kotlinx.coroutines.flow.flow
4242
import kotlinx.coroutines.launch
4343
import kotlinx.coroutines.sync.Mutex
4444
import kotlinx.coroutines.sync.withLock
45-
import kotlinx.datetime.Instant
4645
import kotlinx.datetime.LocalDateTime
4746
import kotlinx.datetime.TimeZone
4847
import kotlinx.datetime.toInstant
4948
import kotlin.time.Duration.Companion.milliseconds
49+
import kotlin.time.Instant
5050

5151
/**
5252
* A PowerSync managed database.

core/src/commonMain/kotlin/com/powersync/sync/Instruction.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.powersync.sync
22

33
import com.powersync.bucket.BucketPriority
4-
import kotlinx.datetime.Instant
54
import kotlinx.serialization.KSerializer
65
import kotlinx.serialization.SerialName
76
import kotlinx.serialization.Serializable
@@ -16,6 +15,7 @@ import kotlinx.serialization.encoding.decodeStructure
1615
import kotlinx.serialization.json.JsonElement
1716
import kotlinx.serialization.json.JsonObject
1817
import kotlinx.serialization.serializer
18+
import kotlin.time.Instant
1919

2020
/**
2121
* An instruction sent to this SDK by the core extension to implement sync behavior.

core/src/commonMain/kotlin/com/powersync/sync/SyncStatus.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import com.powersync.connectors.PowerSyncBackendConnector
55
import kotlinx.coroutines.flow.MutableStateFlow
66
import kotlinx.coroutines.flow.SharedFlow
77
import kotlinx.coroutines.flow.asSharedFlow
8-
import kotlinx.datetime.Clock
9-
import kotlinx.datetime.Instant
8+
import kotlin.time.Clock
9+
import kotlin.time.Instant
1010

1111
@ConsistentCopyVisibility
1212
public data class PriorityStatusEntry internal constructor(

core/src/commonMain/kotlin/com/powersync/sync/SyncStream.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ import kotlinx.coroutines.flow.flow
5656
import kotlinx.coroutines.flow.map
5757
import kotlinx.coroutines.launch
5858
import kotlinx.coroutines.withContext
59-
import kotlinx.datetime.Clock
6059
import kotlinx.io.readByteArray
6160
import kotlinx.io.readIntLe
6261
import kotlinx.serialization.json.JsonElement
6362
import kotlinx.serialization.json.JsonObject
6463
import kotlinx.serialization.json.encodeToJsonElement
64+
import kotlin.time.Clock
6565

6666
@OptIn(ExperimentalPowerSyncAPI::class)
6767
internal class SyncStream(

demos/android-supabase-todolist/app/src/main/java/com/powersync/androidexample/powersync/Todo.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ import kotlinx.coroutines.flow.MutableStateFlow
1515
import kotlinx.coroutines.flow.StateFlow
1616
import kotlinx.coroutines.flow.flowOf
1717
import kotlinx.coroutines.launch
18-
import kotlinx.datetime.Clock
18+
import kotlin.time.Clock
19+
import kotlin.time.ExperimentalTime
1920

21+
@OptIn(ExperimentalTime::class)
2022
internal class Todo(
2123
private val db: PowerSyncDatabase,
2224
private val attachmentsQueue: AttachmentQueue?,

0 commit comments

Comments
 (0)