v0.3.0 released: kotlin 2.2.21 breaking changes with Instant/Clock, etc. adopted in a compatible way
This commit is contained in:
parent
5357b05f4a
commit
1a46c8cab3
17
README.md
17
README.md
@ -4,22 +4,11 @@ Multiplatform binary tools collection, including portable serialization of the c
|
||||
many useful tools to work with binary data, like CRC family checksums, dumps, etc. It works well also in the browser and
|
||||
in native targets.
|
||||
|
||||
# Recent changes
|
||||
# Important note
|
||||
|
||||
- 0.1.12 published on all platforms. many small additions.
|
||||
Currently published version 0.3.0 for all platform is fully compatible with breaking kotlinx.datetime/kotlin.time migration as of Kotlin 2.2.21 and is __a recommended version to use__.
|
||||
|
||||
- 0.1.11 added interesting collection classes: auto-sorted list with comparator, expirable cache, etc.
|
||||
|
||||
- 0.1.7 built with kotlin 2.0.20 which contains important fix in wasmJS
|
||||
|
||||
- 0.1.6 add many useful features, added support to wasmJS and all other platforms. Note to wasmJS: it appears to be a bug in wasm compiler so BipackDecoder could cause wasm loading problem.
|
||||
|
||||
- 0.1.1: added serialized KVStorage with handy implementation on JVM and JS platforms and some required synchronization
|
||||
tools.
|
||||
-
|
||||
- 0.1.0: uses modern kotlin 1.9.*, fixes problem with singleton or empty/object serialization
|
||||
|
||||
The last 1.8-based version is 0.0.8. Some fixes are not yet backported to it pls leave an issue of needed.
|
||||
Sorry for inconveniences, it is all caused by strange ideas of the Kotlin team.
|
||||
|
||||
# Documentation
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") version "2.2.20"
|
||||
kotlin("plugin.serialization") version "2.2.20"
|
||||
kotlin("multiplatform") version "2.2.21"
|
||||
kotlin("plugin.serialization") version "2.2.21"
|
||||
id("org.jetbrains.dokka") version "1.9.20"
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
group = "net.sergeych"
|
||||
version = "0.2.1-SNAPSHOT"
|
||||
version = "0.3.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -17,18 +17,18 @@ repositories {
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
jvmToolchain(17)
|
||||
jvm()
|
||||
js {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
// macosArm64()
|
||||
// iosX64()
|
||||
// iosArm64()
|
||||
// macosX64()
|
||||
// iosSimulatorArm64()
|
||||
macosArm64()
|
||||
iosX64()
|
||||
iosArm64()
|
||||
macosX64()
|
||||
iosSimulatorArm64()
|
||||
linuxX64()
|
||||
linuxArm64()
|
||||
|
||||
@ -50,14 +50,15 @@ kotlin {
|
||||
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
||||
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
|
||||
languageSettings.optIn("kotlin.contracts.ExperimentalContracts")
|
||||
languageSettings.optIn("kotlin.time.ExperimentalTime")
|
||||
}
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||
// this is actually a bug: we need only the core, but bare core causes strange errors
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
|
||||
api("net.sergeych:mp_stools:[1.5.2,)")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1")
|
||||
}
|
||||
}
|
||||
val nativeMain by creating {
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
kotlin.code.style=official
|
||||
kotlin.mpp.applyDefaultHierarchyTemplate=false
|
||||
kotlin.daemon.jvmargs=-Xmx3072M
|
||||
|
||||
org.gradle.parallel=true
|
||||
org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8
|
||||
org.gradle.configuration-cache=true
|
||||
org.gradle.caching=true
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package net.sergeych.bipack
|
||||
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.KSerializer
|
||||
@ -12,6 +11,7 @@ import kotlinx.serialization.modules.EmptySerializersModule
|
||||
import kotlinx.serialization.modules.SerializersModule
|
||||
import kotlinx.serialization.serializer
|
||||
import net.sergeych.bintools.*
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* Decode BiPack format. Note that it relies on [DataSource] so can throw [DataSource.EndOfData]
|
||||
@ -74,7 +74,7 @@ class BipackDecoder(
|
||||
}
|
||||
|
||||
override fun <T> decodeSerializableValue(deserializer: DeserializationStrategy<T>): T {
|
||||
return if (deserializer == Instant.serializer())
|
||||
return if (deserializer == serializer<Instant>())
|
||||
Instant.fromEpochMilliseconds(decodeLong()) as T
|
||||
else
|
||||
super.decodeSerializableValue(deserializer)
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package net.sergeych.bipack
|
||||
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.SerializationStrategy
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.AbstractEncoder
|
||||
@ -9,6 +8,7 @@ import kotlinx.serialization.modules.EmptySerializersModule
|
||||
import kotlinx.serialization.modules.SerializersModule
|
||||
import kotlinx.serialization.serializer
|
||||
import net.sergeych.bintools.*
|
||||
import kotlin.time.Instant
|
||||
|
||||
class BipackEncoder(val output: DataSink) : AbstractEncoder() {
|
||||
|
||||
|
||||
@ -2,11 +2,11 @@ package net.sergeych.collections
|
||||
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import net.sergeych.mptools.withReentrantLock
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* MRU cache with expiration, with safe async concurrent access.
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package net.sergecyh.diwan.tools
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* Value with expiration.
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package net.sergecyh.diwan.tools
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* Experimental.
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package bipack
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import net.sergeych.bintools.encodeToHex
|
||||
@ -13,6 +11,8 @@ import kotlin.test.Test
|
||||
import kotlin.test.assertContentEquals
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertFailsWith
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Instant
|
||||
|
||||
@Serializable
|
||||
data class Foobar1N(val bar: Int, val foo: Int = 117)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user