Skip to content

Update Dokka #3051

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

Merged
merged 4 commits into from
Nov 29, 2021
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
17 changes: 15 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,20 @@ fun version(target: String): String {

dependencies {
implementation(kotlin("gradle-plugin", version("kotlin")))
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${version("dokka")}")
implementation("org.jetbrains.dokka:dokka-core:${version("dokka")}")
/*
* Dokka is compiled with language level = 1.4, but depends on Kotlin 1.6.0, while
* our version of Gradle bundles Kotlin 1.4.x and can read metadata only up to 1.5.x,
* thus we're excluding stdlib compiled with 1.6.0 from dependencies.
*/
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${version("dokka")}") {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
}
implementation("org.jetbrains.dokka:dokka-core:${version("dokka")}") {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
}
implementation("ru.vyarus:gradle-animalsniffer-plugin:1.5.3") // Android API check
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ atomicfu_version=0.17.0
knit_version=0.3.0
html_version=0.7.2
lincheck_version=2.14
dokka_version=1.5.0
dokka_version=1.6.0
byte_buddy_version=1.10.9
reactor_version=3.4.1
reactive_streams_version=1.0.3
Expand Down
11 changes: 11 additions & 0 deletions kotlinx-coroutines-core/common/src/flow/Migration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ public fun <T> Flow<T>.concatWith(value: T): Flow<T> = noImpl()
)
public fun <T> Flow<T>.concatWith(other: Flow<T>): Flow<T> = noImpl()

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'combineLatest' is 'combine'",
Expand All @@ -362,6 +363,7 @@ public fun <T> Flow<T>.concatWith(other: Flow<T>): Flow<T> = noImpl()
public fun <T1, T2, R> Flow<T1>.combineLatest(other: Flow<T2>, transform: suspend (T1, T2) -> R): Flow<R> =
combine(this, other, transform)

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'combineLatest' is 'combine'",
Expand All @@ -373,6 +375,7 @@ public fun <T1, T2, T3, R> Flow<T1>.combineLatest(
transform: suspend (T1, T2, T3) -> R
) = combine(this, other, other2, transform)

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'combineLatest' is 'combine'",
Expand All @@ -385,6 +388,7 @@ public fun <T1, T2, T3, T4, R> Flow<T1>.combineLatest(
transform: suspend (T1, T2, T3, T4) -> R
) = combine(this, other, other2, other3, transform)

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'combineLatest' is 'combine'",
Expand Down Expand Up @@ -422,20 +426,23 @@ public fun <T> Flow<T>.delayFlow(timeMillis: Long): Flow<T> = onStart { delay(ti
)
public fun <T> Flow<T>.delayEach(timeMillis: Long): Flow<T> = onEach { delay(timeMillis) }

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogues of 'switchMap' are 'transformLatest', 'flatMapLatest' and 'mapLatest'",
replaceWith = ReplaceWith("this.flatMapLatest(transform)")
)
public fun <T, R> Flow<T>.switchMap(transform: suspend (value: T) -> Flow<R>): Flow<R> = flatMapLatest(transform)

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR, // Warning since 1.3.8, was experimental when deprecated, ERROR since 1.5.0
message = "'scanReduce' was renamed to 'runningReduce' to be consistent with Kotlin standard library",
replaceWith = ReplaceWith("runningReduce(operation)")
)
public fun <T> Flow<T>.scanReduce(operation: suspend (accumulator: T, value: T) -> T): Flow<T> = runningReduce(operation)

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'publish()' is 'shareIn'. \n" +
Expand All @@ -446,6 +453,7 @@ public fun <T> Flow<T>.scanReduce(operation: suspend (accumulator: T, value: T)
)
public fun <T> Flow<T>.publish(): Flow<T> = noImpl()

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'publish(bufferSize)' is 'buffer' followed by 'shareIn'. \n" +
Expand All @@ -456,6 +464,7 @@ public fun <T> Flow<T>.publish(): Flow<T> = noImpl()
)
public fun <T> Flow<T>.publish(bufferSize: Int): Flow<T> = noImpl()

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'replay()' is 'shareIn' with unlimited replay. \n" +
Expand All @@ -466,6 +475,7 @@ public fun <T> Flow<T>.publish(bufferSize: Int): Flow<T> = noImpl()
)
public fun <T> Flow<T>.replay(): Flow<T> = noImpl()

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'replay(bufferSize)' is 'shareIn' with the specified replay parameter. \n" +
Expand All @@ -476,6 +486,7 @@ public fun <T> Flow<T>.replay(): Flow<T> = noImpl()
)
public fun <T> Flow<T>.replay(bufferSize: Int): Flow<T> = noImpl()

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'cache()' is 'shareIn' with unlimited replay and 'started = SharingStared.Lazily' argument'",
Expand Down
31 changes: 31 additions & 0 deletions kotlinx-coroutines-core/common/src/flow/operators/Lint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import kotlin.internal.InlineOnly
/**
* Applying [cancellable][Flow.cancellable] to a [SharedFlow] has no effect.
* See the [SharedFlow] documentation on Operator Fusion.
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
Expand All @@ -24,6 +25,7 @@ public fun <T> SharedFlow<T>.cancellable(): Flow<T> = noImpl()
/**
* Applying [flowOn][Flow.flowOn] to [SharedFlow] has no effect.
* See the [SharedFlow] documentation on Operator Fusion.
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
Expand All @@ -35,6 +37,7 @@ public fun <T> SharedFlow<T>.flowOn(context: CoroutineContext): Flow<T> = noImpl
/**
* Applying [conflate][Flow.conflate] to [StateFlow] has no effect.
* See the [StateFlow] documentation on Operator Fusion.
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
Expand All @@ -46,6 +49,7 @@ public fun <T> StateFlow<T>.conflate(): Flow<T> = noImpl()
/**
* Applying [distinctUntilChanged][Flow.distinctUntilChanged] to [StateFlow] has no effect.
* See the [StateFlow] documentation on Operator Fusion.
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
Expand All @@ -54,6 +58,9 @@ public fun <T> StateFlow<T>.conflate(): Flow<T> = noImpl()
)
public fun <T> StateFlow<T>.distinctUntilChanged(): Flow<T> = noImpl()

/**
* @suppress
*/
@Deprecated(
message = "isActive is resolved into the extension of outer CoroutineScope which is likely to be an error." +
"Use currentCoroutineContext().isActive or cancellable() operator instead " +
Expand All @@ -65,6 +72,9 @@ public fun <T> StateFlow<T>.distinctUntilChanged(): Flow<T> = noImpl()
public val FlowCollector<*>.isActive: Boolean
get() = noImpl()

/**
* @suppress
*/
@Deprecated(
message = "cancel() is resolved into the extension of outer CoroutineScope which is likely to be an error." +
"Use currentCoroutineContext().cancel() instead or specify the receiver of cancel() explicitly",
Expand All @@ -73,6 +83,9 @@ public val FlowCollector<*>.isActive: Boolean
)
public fun FlowCollector<*>.cancel(cause: CancellationException? = null): Unit = noImpl()

/**
* @suppress
*/
@Deprecated(
message = "coroutineContext is resolved into the property of outer CoroutineScope which is likely to be an error." +
"Use currentCoroutineContext() instead or specify the receiver of coroutineContext explicitly",
Expand All @@ -82,6 +95,9 @@ public fun FlowCollector<*>.cancel(cause: CancellationException? = null): Unit =
public val FlowCollector<*>.coroutineContext: CoroutineContext
get() = noImpl()

/**
* @suppress
*/
@Deprecated(
message = "SharedFlow never completes, so this operator typically has not effect, it can only " +
"catch exceptions from 'onSubscribe' operator",
Expand All @@ -92,6 +108,9 @@ public val FlowCollector<*>.coroutineContext: CoroutineContext
public inline fun <T> SharedFlow<T>.catch(noinline action: suspend FlowCollector<T>.(cause: Throwable) -> Unit): Flow<T> =
(this as Flow<T>).catch(action)

/**
* @suppress
*/
@Deprecated(
message = "SharedFlow never completes, so this operator has no effect.",
level = DeprecationLevel.WARNING,
Expand All @@ -104,6 +123,9 @@ public inline fun <T> SharedFlow<T>.retry(
): Flow<T> =
(this as Flow<T>).retry(retries, predicate)

/**
* @suppress
*/
@Deprecated(
message = "SharedFlow never completes, so this operator has no effect.",
level = DeprecationLevel.WARNING,
Expand All @@ -113,6 +135,9 @@ public inline fun <T> SharedFlow<T>.retry(
public inline fun <T> SharedFlow<T>.retryWhen(noinline predicate: suspend FlowCollector<T>.(cause: Throwable, attempt: Long) -> Boolean): Flow<T> =
(this as Flow<T>).retryWhen(predicate)

/**
* @suppress
*/
@Suppress("DeprecatedCallableAddReplaceWith")
@Deprecated(
message = "SharedFlow never completes, so this terminal operation never completes.",
Expand All @@ -122,6 +147,9 @@ public inline fun <T> SharedFlow<T>.retryWhen(noinline predicate: suspend FlowCo
public suspend inline fun <T> SharedFlow<T>.toList(): List<T> =
(this as Flow<T>).toList()

/**
* @suppress
*/
@Suppress("DeprecatedCallableAddReplaceWith")
@Deprecated(
message = "SharedFlow never completes, so this terminal operation never completes.",
Expand All @@ -131,6 +159,9 @@ public suspend inline fun <T> SharedFlow<T>.toList(): List<T> =
public suspend inline fun <T> SharedFlow<T>.toSet(): Set<T> =
(this as Flow<T>).toSet()

/**
* @suppress
*/
@Suppress("DeprecatedCallableAddReplaceWith")
@Deprecated(
message = "SharedFlow never completes, so this terminal operation never completes.",
Expand Down