Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update plugin com.vanniktech.maven.publish to v0.20.0 #91

Merged
merged 4 commits into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.MavenPublishBasePlugin
import com.vanniktech.maven.publish.SonatypeHost
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.DokkaTask
Expand All @@ -9,7 +12,7 @@ plugins {
kotlin("multiplatform") version "1.6.21"
id("com.diffplug.spotless") version "6.6.1"
id("maven-publish")
id("com.vanniktech.maven.publish") version "0.19.0"
id("com.vanniktech.maven.publish") version "0.20.0"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.10.0"
id("org.jetbrains.dokka") version "1.6.21"
id("org.jetbrains.kotlinx.kover") version "0.5.1"
Expand Down Expand Up @@ -188,9 +191,10 @@ spotless {
}

allprojects {
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = com.vanniktech.maven.publish.SonatypeHost.S01
plugins.withType<MavenPublishBasePlugin> {
extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/commonMain/kotlin/com/hoc081098/flowext/defer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,20 @@ import kotlinx.coroutines.flow.flow
*
* In some circumstances, waiting until the last minute (that is, until collection time)
* to generate the [Flow] can ensure that collectors receive the freshest data.
*
* Example of usage:
*
* ```
* suspend fun remoteCall1(): R1 = ...
* suspend fun remoteCall2(r1: R1): R2 = ...
*
* fun example1(): Flow<R2> = defer {
* val r1 = remoteCall1()
* val r2 = remoteCall2(r1)
* flowOf(r2)
* }
*
* fun example2(): Flow<R1> = defer { flowOf(remoteCall1()) }
* ```
*/
public fun <T> defer(flowFactory: suspend () -> Flow<T>): Flow<T> = flow { emitAll(flowFactory()) }