From 8b7e78b63a0a94e462027b28918a731189e4fdfa Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 21 Apr 2022 16:12:21 +0600 Subject: [PATCH 1/3] start 0.9.24 --- CHANGELOG.md | 2 ++ gradle.properties | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8f64900929..9d1c32d3c6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.9.24 + ## 0.9.23 * `Repos`: diff --git a/gradle.properties b/gradle.properties index 05b78a91bb6..7b86c0ae8a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,5 +14,5 @@ crypto_js_version=4.1.1 # Project data group=dev.inmo -version=0.9.23 -android_code_version=113 +version=0.9.24 +android_code_version=114 From d0dbe3ed2fa95b0f2c3210571ddb2e70d2cdc3ef Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 21 Apr 2022 16:12:58 +0600 Subject: [PATCH 2/3] MPPFile#input --- CHANGELOG.md | 4 ++++ gradle/libs.versions.toml | 1 + ktor/common/build.gradle | 1 + .../dev/inmo/micro_utils/ktor/common/MPPFileInput.kt | 6 ++++++ .../dev/inmo/micro_utils/ktor/common/ActualMPPInput.kt | 7 +++++++ .../dev/inmo/micro_utils/ktor/common/ActualMPPFileInput.kt | 7 +++++++ 6 files changed, 26 insertions(+) create mode 100644 ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/common/MPPFileInput.kt create mode 100644 ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPInput.kt create mode 100644 ktor/common/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPFileInput.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d1c32d3c6e..f656e7402d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.9.24 +* `Ktor`: + * `Common`: + * New extension fun `MPPFile#input` + ## 0.9.23 * `Repos`: diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c31524d819f..e269769e4c8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -39,6 +39,7 @@ kt-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", vers kt-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kt-coroutines" } +ktor-io = { module = "io.ktor:ktor-io", version.ref = "ktor" } ktor-client = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" } ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" } diff --git a/ktor/common/build.gradle b/ktor/common/build.gradle index 7446daad0c7..6b1c636a8a9 100644 --- a/ktor/common/build.gradle +++ b/ktor/common/build.gradle @@ -14,6 +14,7 @@ kotlin { api libs.kt.serialization.cbor api libs.klock api libs.uuid + api libs.ktor.io } } } diff --git a/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/common/MPPFileInput.kt b/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/common/MPPFileInput.kt new file mode 100644 index 00000000000..3d1c742fb73 --- /dev/null +++ b/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/common/MPPFileInput.kt @@ -0,0 +1,6 @@ +package dev.inmo.micro_utils.ktor.common + +import dev.inmo.micro_utils.common.MPPFile +import io.ktor.utils.io.core.Input + +expect fun MPPFile.input(): Input diff --git a/ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPInput.kt b/ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPInput.kt new file mode 100644 index 00000000000..72433cf64d0 --- /dev/null +++ b/ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPInput.kt @@ -0,0 +1,7 @@ +package dev.inmo.micro_utils.ktor.common + +import dev.inmo.micro_utils.common.* +import io.ktor.utils.io.core.ByteReadPacket +import io.ktor.utils.io.core.Input + +actual fun MPPFile.input(): Input = ByteReadPacket(bytesSync()) diff --git a/ktor/common/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPFileInput.kt b/ktor/common/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPFileInput.kt new file mode 100644 index 00000000000..10865adc6cc --- /dev/null +++ b/ktor/common/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPFileInput.kt @@ -0,0 +1,7 @@ +package dev.inmo.micro_utils.ktor.common + +import dev.inmo.micro_utils.common.MPPFile +import io.ktor.utils.io.core.Input +import io.ktor.utils.io.streams.asInput + +actual fun MPPFile.input(): Input = inputStream().asInput() From 19857930a4d0bd1694c7bdb27bb0850157271e37 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 21 Apr 2022 16:45:16 +0600 Subject: [PATCH 3/3] small refactor in actual MPPFileInput --- .../ktor/common/{ActualMPPInput.kt => ActualMPPFileInput.kt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/{ActualMPPInput.kt => ActualMPPFileInput.kt} (71%) diff --git a/ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPInput.kt b/ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPFileInput.kt similarity index 71% rename from ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPInput.kt rename to ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPFileInput.kt index 72433cf64d0..8144362a2d9 100644 --- a/ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPInput.kt +++ b/ktor/common/src/jsMain/kotlin/dev/inmo/micro_utils/ktor/common/ActualMPPFileInput.kt @@ -4,4 +4,4 @@ import dev.inmo.micro_utils.common.* import io.ktor.utils.io.core.ByteReadPacket import io.ktor.utils.io.core.Input -actual fun MPPFile.input(): Input = ByteReadPacket(bytesSync()) +actual fun MPPFile.input(): Input = ByteReadPacket(readBytes())