From f7a388f43814f22b518bb7f064ce6b49260435d1 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 2 Jul 2023 16:05:46 +0600 Subject: [PATCH 1/4] start 2.1.2 --- CHANGELOG.md | 2 ++ gradle.properties | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b9da8..646d190 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 2.1.2 + ## 2.1.1 * `asFlowWithoutDelays` and `asTzFlowWithoutDelays` will have nullable `since` parameters with default to `null` diff --git a/gradle.properties b/gradle.properties index c635ba5..b4c772a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,5 +36,5 @@ androidx_work_version=2.8.1 ## Common -version=2.1.1 -android_code_version=28 +version=2.1.2 +android_code_version=29 From 92df91edd31e0e2fcb06b91468c17a99ea114bb8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 2 Jul 2023 16:06:47 +0600 Subject: [PATCH 2/4] update coroutines --- CHANGELOG.md | 3 +++ gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 646d190..b9ae7e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 2.1.2 +* Versions + * `Coroutines`: `1.7.2` + ## 2.1.1 * `asFlowWithoutDelays` and `asTzFlowWithoutDelays` will have nullable `since` parameters with default to `null` diff --git a/gradle.properties b/gradle.properties index b4c772a..d121917 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ android.enableJetifier=false kotlin_version=1.8.22 -kotlin_coroutines_version=1.6.4 +kotlin_coroutines_version=1.7.2 kotlin_serialization_version=1.5.1 dokka_version=1.8.20 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffa0e6f..3d34695 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip From 69cf7afd4e0eae2dfc44dc68556f714b35d96b30 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 2 Jul 2023 16:41:52 +0600 Subject: [PATCH 3/4] make inline functions callbacks inline again --- CHANGELOG.md | 1 + .../kotlin/dev/inmo/krontab/Executes.kt | 22 +++++++++---------- .../dev/inmo/krontab/utils/StringParseTest.kt | 1 + 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9ae7e1..45f53c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Versions * `Coroutines`: `1.7.2` +* All callbacks for standard extensions like `doInfinity` now fully inline ## 2.1.1 diff --git a/src/commonMain/kotlin/dev/inmo/krontab/Executes.kt b/src/commonMain/kotlin/dev/inmo/krontab/Executes.kt index d106fa2..dc76395 100644 --- a/src/commonMain/kotlin/dev/inmo/krontab/Executes.kt +++ b/src/commonMain/kotlin/dev/inmo/krontab/Executes.kt @@ -14,7 +14,7 @@ import kotlin.coroutines.coroutineContext * * WARNING!!! In case if [KronScheduler.next] of [this] instance will return null, [block] will be called immediately */ -suspend inline fun KronScheduler.doOnce(noinline block: suspend (DateTime) -> T): T { +suspend inline fun KronScheduler.doOnce(block: (DateTime) -> T): T { val time = nextOrNow().also { delay((it - DateTime.now()).millisecondsLong) } @@ -29,7 +29,7 @@ suspend inline fun KronScheduler.doOnce(noinline block: suspend (DateTime) - * WARNING!!! In case if [KronScheduler.next] of [this] instance will return null, [block] will be called immediately */ @Deprecated("Replaceable", ReplaceWith("doOnce", "dev.inmo.krontab.doOnce")) -suspend inline fun KronScheduler.doOnceLocal(noinline block: suspend (DateTime) -> T): T = doOnce(block) +suspend inline fun KronScheduler.doOnceLocal(block: (DateTime) -> T): T = doOnce(block) /** * Execute [block] once at the [KronScheduler.next] time and return result of [block] calculation. @@ -53,7 +53,7 @@ suspend inline fun KronScheduler.doOnceTz(noinline block: suspend (DateTimeT */ suspend inline fun doOnce( scheduleConfig: String, - noinline block: suspend (DateTime) -> T + block: (DateTime) -> T ) = buildSchedule(scheduleConfig).doOnce(block) /** @@ -69,7 +69,7 @@ suspend inline fun doOnceTz( /** * Will execute [block] while it will return true as a result of its calculation */ -suspend inline fun KronScheduler.doWhile(noinline block: suspend (DateTime) -> Boolean) { +suspend inline fun KronScheduler.doWhile(block: (DateTime) -> Boolean) { do { delay(1L) } while (doOnce(block)) @@ -78,7 +78,7 @@ suspend inline fun KronScheduler.doWhile(noinline block: suspend (DateTime) -> B * Will execute [block] while it will return true as a result of its calculation */ @Deprecated("Replaceable", ReplaceWith("doWhile", "dev.inmo.krontab.doWhile")) -suspend inline fun KronScheduler.doWhileLocal(noinline block: suspend (DateTime) -> Boolean) = doWhile(block) +suspend inline fun KronScheduler.doWhileLocal(block: (DateTime) -> Boolean) = doWhile(block) /** * Will execute [block] while it will return true as a result of its calculation @@ -96,7 +96,7 @@ suspend inline fun KronScheduler.doWhileTz(noinline block: suspend (DateTimeTz) */ suspend inline fun doWhile( scheduleConfig: String, - noinline block: suspend (DateTime) -> Boolean + block: (DateTime) -> Boolean ) = buildSchedule(scheduleConfig).doWhile(block) /** @@ -107,7 +107,7 @@ suspend inline fun doWhile( @Deprecated("Replaceable", ReplaceWith("doWhile", "dev.inmo.krontab.doWhile")) suspend inline fun doWhileLocal( scheduleConfig: String, - noinline block: suspend (DateTime) -> Boolean + block: (DateTime) -> Boolean ) = doWhile(scheduleConfig, block) /** @@ -124,7 +124,7 @@ suspend inline fun doWhileTz( /** * Will execute [block] without any checking of result */ -suspend inline fun KronScheduler.doInfinity(noinline block: suspend (DateTime) -> Unit) = doWhile { +suspend inline fun KronScheduler.doInfinity(block: (DateTime) -> Unit) = doWhile { block(it) coroutineContext.isActive } @@ -132,7 +132,7 @@ suspend inline fun KronScheduler.doInfinity(noinline block: suspend (DateTime) - * Will execute [block] without any checking of result */ @Deprecated("Replaceable", ReplaceWith("doInfinity", "dev.inmo.krontab.doInfinity")) -suspend inline fun KronScheduler.doInfinityLocal(noinline block: suspend (DateTime) -> Unit) = doInfinity(block) +suspend inline fun KronScheduler.doInfinityLocal(block: (DateTime) -> Unit) = doInfinity(block) /** * Will execute [block] without any checking of result @@ -149,7 +149,7 @@ suspend inline fun KronScheduler.doInfinityTz(noinline block: suspend (DateTimeT */ suspend inline fun doInfinity( scheduleConfig: String, - noinline block: suspend (DateTime) -> Unit + block: (DateTime) -> Unit ) = buildSchedule(scheduleConfig).doInfinity(block) /** @@ -160,7 +160,7 @@ suspend inline fun doInfinity( @Deprecated("Replaceable", ReplaceWith("doInfinity", "dev.inmo.krontab.doInfinity")) suspend inline fun doInfinityLocal( scheduleConfig: String, - noinline block: suspend (DateTime) -> Unit + block: (DateTime) -> Unit ) = doInfinity(scheduleConfig, block) /** diff --git a/src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt b/src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt index 3e76d0a..09d6e8b 100644 --- a/src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt +++ b/src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt @@ -3,6 +3,7 @@ package dev.inmo.krontab.utils import korlibs.time.* import dev.inmo.krontab.KronSchedulerTz import dev.inmo.krontab.buildSchedule +import dev.inmo.krontab.doInfinity import kotlinx.coroutines.* import kotlinx.coroutines.flow.takeWhile import kotlinx.coroutines.test.runTest From f66c1c24779eb18379aa8bc53b2ebed8bd289b9e Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 5 Jul 2023 20:05:39 +0600 Subject: [PATCH 4/4] remove redundant change in string parse change --- src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt b/src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt index 09d6e8b..3e76d0a 100644 --- a/src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt +++ b/src/commonTest/kotlin/dev/inmo/krontab/utils/StringParseTest.kt @@ -3,7 +3,6 @@ package dev.inmo.krontab.utils import korlibs.time.* import dev.inmo.krontab.KronSchedulerTz import dev.inmo.krontab.buildSchedule -import dev.inmo.krontab.doInfinity import kotlinx.coroutines.* import kotlinx.coroutines.flow.takeWhile import kotlinx.coroutines.test.runTest