Migrate to kotlin.time.Instant and kotlin.time.Clock, update dependencies to support Kotlin 2.2, and adopt JVM 17.
This commit is contained in:
1 parent
1aef64e0fa
commit
f7a4497f3f
10 files changed
+75
-22
No files matched your search
@@ -38,7 +38,7 @@ kotlin {
|
||||
publishLibraryVariants("release")
|
||||
@OptIn(ExperimentalKotlinGradlePluginApi::class)
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_11)
|
||||
jvmTarget.set(JvmTarget.JVM_17)
|
||||
}
|
||||
}
|
||||
iosX64()
|
||||
@@ -71,11 +71,7 @@ kotlin {
|
||||
sourceSets {
|
||||
all {
|
||||
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
|
||||
// languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
|
||||
// Correct opt-in markers for coroutines
|
||||
// languageSettings.optIn("kotlinx.coroutines.DelicateCoroutinesApi")
|
||||
// languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
|
||||
// languageSettings.optIn("kotlinx.coroutines.FlowPreview")
|
||||
languageSettings.optIn("kotlin.time.ExperimentalTime")
|
||||
}
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
@@ -115,8 +111,8 @@ android {
|
||||
minSdk = libs.versions.android.minSdk.get().toInt()
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
lint {
|
||||
// Prevent Android Lint from failing the build due to Kotlin toolchain
|
||||
|
||||
@@ -163,7 +163,7 @@ private suspend fun buildFsModule(module: ModuleScope, policy: FsAccessPolicy) {
|
||||
fsGuard {
|
||||
val self = this.thisObj as ObjPath
|
||||
val m = self.ensureMetadata()
|
||||
m.createdAtMillis?.let { ObjInstant(kotlinx.datetime.Instant.fromEpochMilliseconds(it)) } ?: ObjNull
|
||||
m.createdAtMillis?.let { ObjInstant(kotlin.time.Instant.fromEpochMilliseconds(it)) } ?: ObjNull
|
||||
}
|
||||
}
|
||||
// createdAtMillis(): Int? — milliseconds since epoch or null
|
||||
|
||||
Reference in new issue
Block a user