diff options
author | Leonid Startsev <sandwwraith@users.noreply.github.com> | 2023-09-21 14:46:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-21 14:46:24 +0200 |
commit | 7b75e39ae6837bfad04d0d18b24bd0facbf9e63c (patch) | |
tree | 1688c15a7d5c32771e52eccc974e8cbfd6cd6aa0 /formats/json-tests | |
parent | 7d287c84e83e6af4c5c0ecb27cd573db9d0cffd9 (diff) | |
download | kotlinx.serialization-7b75e39ae6837bfad04d0d18b24bd0facbf9e63c.tar.gz |
Get rid of @Suppress("INVISIBLE_REFERENCE") for usage of internal declarations (#2444)
* Introduce additional internal opt-in annotation to hide declarations even more
* Rename JsonWriter and SerialReader to something more internal-ish
* Refactor internal extensions on Json into top-level functions to remove them from completion (because even optable-in declarations are shown in completion for all users)
* Propagate opt-ins to verifyKotlinModule task
Related: https://youtrack.jetbrains.com/issue/KTIJ-27132
Diffstat (limited to 'formats/json-tests')
-rw-r--r-- | formats/json-tests/build.gradle.kts | 8 | ||||
-rw-r--r-- | formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTestBase.kt | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/formats/json-tests/build.gradle.kts b/formats/json-tests/build.gradle.kts index 95b9e1c0..3c84e29d 100644 --- a/formats/json-tests/build.gradle.kts +++ b/formats/json-tests/build.gradle.kts @@ -25,6 +25,12 @@ tasks.named("koverVerify") { kotlin { sourceSets { + configureEach { + languageSettings { + optIn("kotlinx.serialization.internal.CoreFriendModuleApi") + optIn("kotlinx.serialization.json.internal.JsonFriendModuleApi") + } + } val commonTest by getting { dependencies { api(project(":kotlinx-serialization-json")) @@ -64,4 +70,4 @@ if (!isNewWasmTargetEnabled) { tasks.named("wasmD8Test", KotlinJsTest::class) { filter.excludePatterns += "kotlinx.serialization.features.EmojiTest" } -}
\ No newline at end of file +} diff --git a/formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTestBase.kt b/formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTestBase.kt index ebcc3d07..6f3b132e 100644 --- a/formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTestBase.kt +++ b/formats/json-tests/commonTest/src/kotlinx/serialization/json/JsonTestBase.kt @@ -49,7 +49,7 @@ abstract class JsonTestBase { encodeViaStream(serializer, value) } JsonTestingMode.TREE -> { - val tree = writeJson(value, serializer) + val tree = writeJson(this, value, serializer) encodeToString(tree) } JsonTestingMode.OKIO_STREAMS -> { @@ -77,8 +77,8 @@ abstract class JsonTestBase { decodeViaStream(deserializer, source) } JsonTestingMode.TREE -> { - val tree = decodeStringToJsonTree(deserializer, source) - readJson(tree, deserializer) + val tree = decodeStringToJsonTree(this, deserializer, source) + readJson(this, tree, deserializer) } JsonTestingMode.OKIO_STREAMS -> { val buffer = Buffer() |