mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2026-04-18 06:02:27 +00:00
Compare commits
7 Commits
2.7.0
...
51002f0f03
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51002f0f03 | ||
| b59c325641 | |||
| de64a4d806 | |||
| 409ca3770f | |||
| 08ef7281e5 | |||
| c28bf17335 | |||
|
|
e5b33ae9b0 |
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2.7.1
|
||||||
|
|
||||||
|
* Fixes in parser and checker
|
||||||
|
|
||||||
## 2.7.0
|
## 2.7.0
|
||||||
|
|
||||||
* `Version`:
|
* `Version`:
|
||||||
|
|||||||
@@ -36,5 +36,5 @@ androidx_work_version=2.10.0
|
|||||||
|
|
||||||
## Common
|
## Common
|
||||||
|
|
||||||
version=2.7.0
|
version=2.7.1
|
||||||
android_code_version=46
|
android_code_version=47
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import kotlinx.coroutines.delay
|
|||||||
import kotlinx.coroutines.isActive
|
import kotlinx.coroutines.isActive
|
||||||
import kotlin.coroutines.coroutineContext
|
import kotlin.coroutines.coroutineContext
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute [block] once at the [KronScheduler.next] time and return result of [block] calculation.
|
* Execute [block] once at the [KronScheduler.next] time and return result of [block] calculation.
|
||||||
*
|
*
|
||||||
@@ -55,7 +54,7 @@ suspend inline fun <T> KronScheduler.doOnceTz(noinline block: suspend (DateTimeT
|
|||||||
* @see buildSchedule
|
* @see buildSchedule
|
||||||
*/
|
*/
|
||||||
suspend inline fun <T> doOnce(
|
suspend inline fun <T> doOnce(
|
||||||
scheduleConfig: String,
|
@Language("CronExp") scheduleConfig: String,
|
||||||
block: (DateTime) -> T
|
block: (DateTime) -> T
|
||||||
) = buildSchedule(scheduleConfig).doOnce(block)
|
) = buildSchedule(scheduleConfig).doOnce(block)
|
||||||
|
|
||||||
@@ -64,7 +63,7 @@ suspend inline fun <T> doOnce(
|
|||||||
* @see buildSchedule
|
* @see buildSchedule
|
||||||
*/
|
*/
|
||||||
suspend inline fun <T> doOnceTz(
|
suspend inline fun <T> doOnceTz(
|
||||||
scheduleConfig: String,
|
@Language("CronExp") scheduleConfig: String,
|
||||||
noinline block: suspend (DateTimeTz) -> T
|
noinline block: suspend (DateTimeTz) -> T
|
||||||
) = buildSchedule(scheduleConfig).doOnceTz(block)
|
) = buildSchedule(scheduleConfig).doOnceTz(block)
|
||||||
|
|
||||||
@@ -116,7 +115,7 @@ suspend inline fun KronScheduler.doWhileTz(noinline block: suspend (DateTimeTz)
|
|||||||
* @see buildSchedule
|
* @see buildSchedule
|
||||||
*/
|
*/
|
||||||
suspend inline fun doWhile(
|
suspend inline fun doWhile(
|
||||||
scheduleConfig: String,
|
@Language("CronExp") scheduleConfig: String,
|
||||||
block: (DateTime) -> Boolean
|
block: (DateTime) -> Boolean
|
||||||
) = buildSchedule(scheduleConfig).doWhile(block)
|
) = buildSchedule(scheduleConfig).doWhile(block)
|
||||||
|
|
||||||
@@ -127,7 +126,7 @@ suspend inline fun doWhile(
|
|||||||
*/
|
*/
|
||||||
@Deprecated("Replaceable", ReplaceWith("doWhile", "dev.inmo.krontab.doWhile"))
|
@Deprecated("Replaceable", ReplaceWith("doWhile", "dev.inmo.krontab.doWhile"))
|
||||||
suspend inline fun doWhileLocal(
|
suspend inline fun doWhileLocal(
|
||||||
scheduleConfig: String,
|
@Language("CronExp") scheduleConfig: String,
|
||||||
block: (DateTime) -> Boolean
|
block: (DateTime) -> Boolean
|
||||||
) = doWhile(scheduleConfig, block)
|
) = doWhile(scheduleConfig, block)
|
||||||
|
|
||||||
@@ -137,7 +136,7 @@ suspend inline fun doWhileLocal(
|
|||||||
* @see buildSchedule
|
* @see buildSchedule
|
||||||
*/
|
*/
|
||||||
suspend inline fun doWhileTz(
|
suspend inline fun doWhileTz(
|
||||||
scheduleConfig: String,
|
@Language("CronExp") scheduleConfig: String,
|
||||||
noinline block: suspend (DateTimeTz) -> Boolean
|
noinline block: suspend (DateTimeTz) -> Boolean
|
||||||
) = buildSchedule(scheduleConfig).doWhileTz(block)
|
) = buildSchedule(scheduleConfig).doWhileTz(block)
|
||||||
|
|
||||||
@@ -169,7 +168,7 @@ suspend inline fun KronScheduler.doInfinityTz(noinline block: suspend (DateTimeT
|
|||||||
* @see buildSchedule
|
* @see buildSchedule
|
||||||
*/
|
*/
|
||||||
suspend inline fun doInfinity(
|
suspend inline fun doInfinity(
|
||||||
scheduleConfig: String,
|
@Language("CronExp") scheduleConfig: String,
|
||||||
block: (DateTime) -> Unit
|
block: (DateTime) -> Unit
|
||||||
) = buildSchedule(scheduleConfig).doInfinity(block)
|
) = buildSchedule(scheduleConfig).doInfinity(block)
|
||||||
|
|
||||||
@@ -180,7 +179,7 @@ suspend inline fun doInfinity(
|
|||||||
*/
|
*/
|
||||||
@Deprecated("Replaceable", ReplaceWith("doInfinity", "dev.inmo.krontab.doInfinity"))
|
@Deprecated("Replaceable", ReplaceWith("doInfinity", "dev.inmo.krontab.doInfinity"))
|
||||||
suspend inline fun doInfinityLocal(
|
suspend inline fun doInfinityLocal(
|
||||||
scheduleConfig: String,
|
@Language("CronExp") scheduleConfig: String,
|
||||||
block: (DateTime) -> Unit
|
block: (DateTime) -> Unit
|
||||||
) = doInfinity(scheduleConfig, block)
|
) = doInfinity(scheduleConfig, block)
|
||||||
|
|
||||||
@@ -190,6 +189,6 @@ suspend inline fun doInfinityLocal(
|
|||||||
* @see buildSchedule
|
* @see buildSchedule
|
||||||
*/
|
*/
|
||||||
suspend inline fun doInfinityTz(
|
suspend inline fun doInfinityTz(
|
||||||
scheduleConfig: String,
|
@Language("CronExp") scheduleConfig: String,
|
||||||
noinline block: suspend (DateTimeTz) -> Unit
|
noinline block: suspend (DateTimeTz) -> Unit
|
||||||
) = buildSchedule(scheduleConfig).doInfinityTz(block)
|
) = buildSchedule(scheduleConfig).doInfinityTz(block)
|
||||||
|
|||||||
6
src/commonMain/kotlin/Language.kt
Normal file
6
src/commonMain/kotlin/Language.kt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package dev.inmo.krontab
|
||||||
|
|
||||||
|
import kotlin.OptionalExpectation
|
||||||
|
|
||||||
|
@OptionalExpectation
|
||||||
|
internal expect annotation class Language(val value: String, val prefix: String = "", val suffix: String = "")
|
||||||
@@ -43,7 +43,9 @@ private fun <T> createSimpleScheduler(from: String, dataRange: IntRange, dataCon
|
|||||||
* 1.
|
* 1.
|
||||||
* * "\\d" -> 2
|
* * "\\d" -> 2
|
||||||
* * "\\*" -> 4
|
* * "\\*" -> 4
|
||||||
|
* * "F" -> 7
|
||||||
* * "f" -> 7
|
* * "f" -> 7
|
||||||
|
* * "L" -> 7
|
||||||
* * "l" -> 7
|
* * "l" -> 7
|
||||||
* * "/" -> 6
|
* * "/" -> 6
|
||||||
* 2.
|
* 2.
|
||||||
@@ -55,6 +57,7 @@ private fun <T> createSimpleScheduler(from: String, dataRange: IntRange, dataCon
|
|||||||
* * "o" -> 10
|
* * "o" -> 10
|
||||||
* * "w" -> 10
|
* * "w" -> 10
|
||||||
* 3.
|
* 3.
|
||||||
|
* * "L" -> 7
|
||||||
* * "l" -> 7
|
* * "l" -> 7
|
||||||
* * "\\d" -> 8
|
* * "\\d" -> 8
|
||||||
* 4.
|
* 4.
|
||||||
@@ -78,8 +81,8 @@ private val checkIncomingPartTransitionsMap = listOf(
|
|||||||
listOf( // 0
|
listOf( // 0
|
||||||
Regex("\\d") to 1,
|
Regex("\\d") to 1,
|
||||||
Regex("\\*") to 3,
|
Regex("\\*") to 3,
|
||||||
Regex("f") to 6,
|
Regex("[Ff]") to 6,
|
||||||
Regex("l") to 6,
|
Regex("[Ll]") to 6,
|
||||||
Regex("/") to 5,
|
Regex("/") to 5,
|
||||||
),
|
),
|
||||||
listOf( // 1
|
listOf( // 1
|
||||||
@@ -92,7 +95,7 @@ private val checkIncomingPartTransitionsMap = listOf(
|
|||||||
Regex("w") to 9,
|
Regex("w") to 9,
|
||||||
),
|
),
|
||||||
listOf( // 2
|
listOf( // 2
|
||||||
Regex("l") to 6,
|
Regex("[Ll]") to 6,
|
||||||
Regex("\\d") to 7,
|
Regex("\\d") to 7,
|
||||||
),
|
),
|
||||||
listOf( // 3
|
listOf( // 3
|
||||||
|
|||||||
5
src/jvmMain/kotlin/Language.kt
Normal file
5
src/jvmMain/kotlin/Language.kt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package dev.inmo.krontab
|
||||||
|
|
||||||
|
import org.intellij.lang.annotations.Language
|
||||||
|
|
||||||
|
actual typealias Language = Language
|
||||||
Reference in New Issue
Block a user