mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2024-11-22 16:23:55 +00:00
commit
2b06033c75
4
.github/workflows/publishing_packages.yml
vendored
4
.github/workflows/publishing_packages.yml
vendored
@ -8,9 +8,9 @@ jobs:
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Fix android 31.0.0 dx
|
||||
- name: Fix android 32.0.0 dx
|
||||
continue-on-error: true
|
||||
run: cd /usr/local/lib/android/sdk/build-tools/31.0.0/ && mv d8 dx && cd lib && mv d8.jar dx.jar
|
||||
run: cd /usr/local/lib/android/sdk/build-tools/32.0.0/ && mv d8 dx && cd lib && mv d8.jar dx.jar
|
||||
- name: Update version
|
||||
run: |
|
||||
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
||||
|
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,5 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## 0.7.0
|
||||
|
||||
**ALL DEPRECATIONS HAVE BEEN REMOVED**
|
||||
|
||||
* Versions
|
||||
* `Kotlin`: `1.6.10`
|
||||
* `Klock`: `2.4.10`
|
||||
* `Coroutines`: `1.6.0`
|
||||
* `Androidx Work`: `2.7.1`
|
||||
|
||||
## 0.6.6
|
||||
|
||||
* Versions
|
||||
|
@ -134,7 +134,6 @@ android {
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(8)
|
||||
}
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ android.useAndroidX=true
|
||||
android.enableJetifier=false
|
||||
|
||||
|
||||
kotlin_version=1.5.31
|
||||
kotlin_coroutines_version=1.5.2
|
||||
kotlin_version=1.6.10
|
||||
kotlin_coroutines_version=1.6.0
|
||||
|
||||
dokka_version=1.5.31
|
||||
dokka_version=1.6.0
|
||||
|
||||
klockVersion=2.4.8
|
||||
klockVersion=2.4.10
|
||||
|
||||
## Github reease
|
||||
|
||||
@ -22,16 +22,16 @@ github_release_plugin_version=2.2.12
|
||||
## Android
|
||||
|
||||
android_minSdkVersion=19
|
||||
android_compileSdkVersion=31
|
||||
android_buildToolsVersion=31.0.0
|
||||
android_compileSdkVersion=32
|
||||
android_buildToolsVersion=32.0.0
|
||||
dexcount_version=3.0.0
|
||||
junit_version=4.12
|
||||
test_ext_junit_version=1.1.2
|
||||
espresso_core=3.3.0
|
||||
|
||||
androidx_work_version=2.7.0
|
||||
androidx_work_version=2.7.1
|
||||
|
||||
## Common
|
||||
|
||||
version=0.6.6
|
||||
android_code_version=10
|
||||
version=0.7.0
|
||||
android_code_version=11
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -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.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||
|
@ -2,7 +2,6 @@ package dev.inmo.krontab.internal
|
||||
|
||||
import com.soywiz.klock.DateTime
|
||||
import dev.inmo.krontab.KronScheduler
|
||||
import dev.inmo.krontab.collection.plus
|
||||
|
||||
/**
|
||||
* Cron-oriented realisation of [KronScheduler]
|
||||
@ -36,23 +35,3 @@ internal fun mergeCronDateTimeSchedulers(
|
||||
): CronDateTimeScheduler = CronDateTimeScheduler(
|
||||
schedulers.map { it.cronDateTime }.merge()
|
||||
)
|
||||
|
||||
/**
|
||||
* @return New instance of [CronDateTimeScheduler] with all unique [CronDateTimeScheduler.cronDateTimes] of
|
||||
* [kronSchedulers] included
|
||||
*/
|
||||
@Deprecated("Will be removed in next major release", ReplaceWith("merge", "dev.inmo.krontab"))
|
||||
fun merge(kronSchedulers: List<KronScheduler>) = kronSchedulers.apply { dev.inmo.krontab.merge() }
|
||||
|
||||
/**
|
||||
* @return Vararg shortcut for [dev.inmo.krontab.merge]
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@Deprecated("Will be removed in next major release", ReplaceWith("merge", "dev.inmo.krontab"))
|
||||
inline fun merge(vararg kronDateTimeSchedulers: KronScheduler) = kronDateTimeSchedulers.apply { dev.inmo.krontab.merge() }
|
||||
/**
|
||||
* @return Vararg shortcut for [dev.inmo.krontab.merge]
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
@Deprecated("Will be removed in next major release", ReplaceWith("merge", "dev.inmo.krontab"))
|
||||
inline fun KronScheduler.plus(other: KronScheduler) = this + other
|
||||
|
@ -4,8 +4,8 @@ import com.soywiz.klock.DateTime
|
||||
import com.soywiz.klock.DateTimeTz
|
||||
import dev.inmo.krontab.*
|
||||
import kotlinx.coroutines.FlowPreview
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.channelFlow
|
||||
|
||||
/**
|
||||
* This [Flow] will trigger emitting each near time which will be returned from [this] [KronScheduler] with attention to
|
||||
@ -33,23 +33,3 @@ fun KronScheduler.asFlow(): Flow<DateTime> = channelFlow {
|
||||
send(it)
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
"It is not recommended to use this class in future. This functionality will be removed soon",
|
||||
ReplaceWith("asFlow", "dev.inmo.krontab.utils.asFlow")
|
||||
)
|
||||
@FlowPreview
|
||||
class SchedulerFlow(
|
||||
private val scheduler: KronScheduler
|
||||
) : AbstractFlow<DateTime>() {
|
||||
@FlowPreview
|
||||
override suspend fun collectSafely(collector: FlowCollector<DateTime>) {
|
||||
while (true) {
|
||||
val now = DateTime.now()
|
||||
val nextTime = scheduler.next(now) ?: break
|
||||
val sleepDelay = (nextTime - now).millisecondsLong
|
||||
delay(sleepDelay)
|
||||
collector.emit(nextTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user