Skip to content

Commit

Permalink
Update kotlinx.serialization to v1.6.2 (#68)
Browse files Browse the repository at this point in the history
* Update kotlinx.serialization to v1.6.2

* Fix compilation issue

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Emil Kantis <[email protected]>
  • Loading branch information
renovate[bot] and Kantis authored Feb 3, 2024
1 parent 772c65f commit 2926da1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dokka = "1.9.10"
dokkatoo = "2.0.0"

kotlin = "1.9.22"
kotlinx-serialization = "1.5.0"
kotlinx-serialization = "1.6.2"

kotest = "5.8.0"
kotest-propertyArbsExtension = "2.1.2"
Expand Down
8 changes: 8 additions & 0 deletions ks3-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ tasks.withType<dev.adamko.dokkatoo.tasks.DokkatooGenerateTask>().configureEach {
}

kotlin {
targets.configureEach {
compilations.all {
kotlinOptions {
freeCompilerArgs += listOf("-opt-in=kotlinx.serialization.json.internal.JsonFriendModuleApi")
}
}
}

sourceSets {
commonMain {
dependencies {
Expand Down
6 changes: 3 additions & 3 deletions ks3-test/src/commonMain/kotlin/io.ks3.test/TestHelpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ inline fun <reified T> Json.encoders(serializer: KSerializer<T>): List<Encoder<T
},
)

@OptIn(InternalSerializationApi::class, ExperimentalSerializationApi::class)
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
inline fun <reified T> Json.decoders(serializer: KSerializer<T>): List<Decoder<T>> =
listOf(
{ decodeFromString(serializer, this) },
{
val tree = decodeStringToJsonTree(serializer, this)
readJson(tree, serializer)
val tree = decodeStringToJsonTree(this@decoders, serializer, this)
readJson(this@decoders, tree, serializer)
},
{
val buffer = Buffer()
Expand Down

0 comments on commit 2926da1

Please sign in to comment.