From c8833a36aff1438ade9b0f6f8f8fc3a8882c21aa Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 25 May 2023 20:58:05 +0600 Subject: [PATCH 1/3] start 0.19.0 --- CHANGELOG.md | 2 ++ gradle.properties | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc0af043fba..02b37afc84f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.19.0 + ## 0.18.4 * `Koin`: diff --git a/gradle.properties b/gradle.properties index c5300e441c6..55036a46996 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,5 +14,5 @@ crypto_js_version=4.1.1 # Project data group=dev.inmo -version=0.18.4 -android_code_version=195 +version=0.19.0 +android_code_version=196 From d34e3ec7a906e716be19df0fd705bf119d94dbd7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 25 May 2023 21:08:12 +0600 Subject: [PATCH 2/3] update dependencies --- CHANGELOG.md | 3 +++ .../src/commonMain/kotlin/dev/inmo/micro_utils/crypto/MD5.kt | 2 +- gradle/libs.versions.toml | 2 +- .../dev/inmo/micro_utils/ktor/common/FromToDateTimeUrl.kt | 2 +- .../dev/inmo/micro_utils/ktor/server/FromToDateTimeInUrl.kt | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02b37afc84f..1c88012e421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.19.0 +* `Versions`: + * `Korlibs`: `4.0.1` + ## 0.18.4 * `Koin`: diff --git a/crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/MD5.kt b/crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/MD5.kt index 37dc958212c..83fb48ebfa8 100644 --- a/crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/MD5.kt +++ b/crypto/src/commonMain/kotlin/dev/inmo/micro_utils/crypto/MD5.kt @@ -1,6 +1,6 @@ package dev.inmo.micro_utils.crypto -import com.soywiz.krypto.md5 +import korlibs.crypto.md5 typealias MD5 = String diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 733b7ddb500..bc5b1187f25 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,7 @@ jb-compose = "1.4.0" jb-exposed = "0.41.1" jb-dokka = "1.8.10" -korlibs = "3.4.0" +korlibs = "4.0.1" uuid = "0.7.0" ktor = "2.3.0" diff --git a/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/common/FromToDateTimeUrl.kt b/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/common/FromToDateTimeUrl.kt index ff015524268..d6707f69d3a 100644 --- a/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/common/FromToDateTimeUrl.kt +++ b/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/ktor/common/FromToDateTimeUrl.kt @@ -1,6 +1,6 @@ package dev.inmo.micro_utils.ktor.common -import com.soywiz.klock.DateTime +import korlibs.time.DateTime typealias FromToDateTime = Pair diff --git a/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/FromToDateTimeInUrl.kt b/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/FromToDateTimeInUrl.kt index c7e850a9bfd..c266187966a 100644 --- a/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/FromToDateTimeInUrl.kt +++ b/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/ktor/server/FromToDateTimeInUrl.kt @@ -1,6 +1,6 @@ package dev.inmo.micro_utils.ktor.server -import com.soywiz.klock.DateTime +import korlibs.time.DateTime import dev.inmo.micro_utils.ktor.common.FromToDateTime import io.ktor.http.Parameters From ea9dbf2371f565a8b230350e6c7386dca8075c78 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 25 May 2023 21:12:21 +0600 Subject: [PATCH 3/3] Koin.get and Scope.get with opportunity to get dependency by its type and definition --- .../commonMain/kotlin/GetWithDefinition.kt | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 koin/src/commonMain/kotlin/GetWithDefinition.kt diff --git a/koin/src/commonMain/kotlin/GetWithDefinition.kt b/koin/src/commonMain/kotlin/GetWithDefinition.kt new file mode 100644 index 00000000000..32cc88bad9e --- /dev/null +++ b/koin/src/commonMain/kotlin/GetWithDefinition.kt @@ -0,0 +1,40 @@ +package dev.inmo.micro_utils.koin + +import org.koin.core.Koin +import org.koin.core.definition.BeanDefinition +import org.koin.core.definition.KoinDefinition +import org.koin.core.instance.InstanceFactory +import org.koin.core.parameter.ParametersDefinition +import org.koin.core.scope.Scope + +fun Koin.get(definition: BeanDefinition, parameters: ParametersDefinition? = null): T = get( + definition.primaryType, + definition.qualifier, + parameters +) + +fun Koin.get(definition: InstanceFactory, parameters: ParametersDefinition? = null): T = get( + definition.beanDefinition, + parameters +) + +fun Koin.get(definition: KoinDefinition, parameters: ParametersDefinition? = null): T = get( + definition.factory, + parameters +) + +fun Scope.get(definition: BeanDefinition, parameters: ParametersDefinition? = null): T = get( + definition.primaryType, + definition.qualifier, + parameters +) + +fun Scope.get(definition: InstanceFactory, parameters: ParametersDefinition? = null): T = get( + definition.beanDefinition, + parameters +) + +fun Scope.get(definition: KoinDefinition, parameters: ParametersDefinition? = null): T = get( + definition.factory, + parameters +)