From 12bb96fe143d1d9b2f51127c84cdefb72917ac11 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Thu, 25 Nov 2021 19:29:54 +0300 Subject: [PATCH 1/4] Update Dokka --- buildSrc/build.gradle.kts | 19 ++++++++++++++++--- gradle.properties | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index c2808c004a..60a4029efe 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -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")}") - implementation("ru.vyarus:gradle-animalsniffer-plugin:1.5.3") // Android API check + /* + * 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 implementation("ru.vyarus:gradle-animalsniffer-plugin:1.5.3") // Android API check } diff --git a/gradle.properties b/gradle.properties index 1d64c83611..8b90094a95 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 From 98de2c12715c3dba45136c98a4751402a0bde5b1 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Thu, 25 Nov 2021 19:43:26 +0300 Subject: [PATCH 2/4] Suppress Lint declarations from Dokka documentation --- .../common/src/flow/operators/Lint.kt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt b/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt index 83f83e1e15..b140e6280c 100644 --- a/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt +++ b/kotlinx-coroutines-core/common/src/flow/operators/Lint.kt @@ -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, @@ -24,6 +25,7 @@ public fun SharedFlow.cancellable(): Flow = noImpl() /** * Applying [flowOn][Flow.flowOn] to [SharedFlow] has no effect. * See the [SharedFlow] documentation on Operator Fusion. + * @suppress */ @Deprecated( level = DeprecationLevel.ERROR, @@ -35,6 +37,7 @@ public fun SharedFlow.flowOn(context: CoroutineContext): Flow = noImpl /** * Applying [conflate][Flow.conflate] to [StateFlow] has no effect. * See the [StateFlow] documentation on Operator Fusion. + * @suppress */ @Deprecated( level = DeprecationLevel.ERROR, @@ -46,6 +49,7 @@ public fun StateFlow.conflate(): Flow = noImpl() /** * Applying [distinctUntilChanged][Flow.distinctUntilChanged] to [StateFlow] has no effect. * See the [StateFlow] documentation on Operator Fusion. + * @suppress */ @Deprecated( level = DeprecationLevel.ERROR, @@ -54,6 +58,9 @@ public fun StateFlow.conflate(): Flow = noImpl() ) public fun StateFlow.distinctUntilChanged(): Flow = 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 " + @@ -65,6 +72,9 @@ public fun StateFlow.distinctUntilChanged(): Flow = 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", @@ -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", @@ -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", @@ -92,6 +108,9 @@ public val FlowCollector<*>.coroutineContext: CoroutineContext public inline fun SharedFlow.catch(noinline action: suspend FlowCollector.(cause: Throwable) -> Unit): Flow = (this as Flow).catch(action) +/** + * @suppress + */ @Deprecated( message = "SharedFlow never completes, so this operator has no effect.", level = DeprecationLevel.WARNING, @@ -104,6 +123,9 @@ public inline fun SharedFlow.retry( ): Flow = (this as Flow).retry(retries, predicate) +/** + * @suppress + */ @Deprecated( message = "SharedFlow never completes, so this operator has no effect.", level = DeprecationLevel.WARNING, @@ -113,6 +135,9 @@ public inline fun SharedFlow.retry( public inline fun SharedFlow.retryWhen(noinline predicate: suspend FlowCollector.(cause: Throwable, attempt: Long) -> Boolean): Flow = (this as Flow).retryWhen(predicate) +/** + * @suppress + */ @Suppress("DeprecatedCallableAddReplaceWith") @Deprecated( message = "SharedFlow never completes, so this terminal operation never completes.", @@ -122,6 +147,9 @@ public inline fun SharedFlow.retryWhen(noinline predicate: suspend FlowCo public suspend inline fun SharedFlow.toList(): List = (this as Flow).toList() +/** + * @suppress + */ @Suppress("DeprecatedCallableAddReplaceWith") @Deprecated( message = "SharedFlow never completes, so this terminal operation never completes.", @@ -131,6 +159,9 @@ public suspend inline fun SharedFlow.toList(): List = public suspend inline fun SharedFlow.toSet(): Set = (this as Flow).toSet() +/** + * @suppress + */ @Suppress("DeprecatedCallableAddReplaceWith") @Deprecated( message = "SharedFlow never completes, so this terminal operation never completes.", From b8720222e27fc8d627cf9846e37538ffe676b83e Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Thu, 25 Nov 2021 20:10:35 +0300 Subject: [PATCH 3/4] Suppress Migration declarations from Dokka documentation --- kotlinx-coroutines-core/common/src/flow/Migration.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kotlinx-coroutines-core/common/src/flow/Migration.kt b/kotlinx-coroutines-core/common/src/flow/Migration.kt index 64effbf395..e398740bbb 100644 --- a/kotlinx-coroutines-core/common/src/flow/Migration.kt +++ b/kotlinx-coroutines-core/common/src/flow/Migration.kt @@ -354,6 +354,7 @@ public fun Flow.concatWith(value: T): Flow = noImpl() ) public fun Flow.concatWith(other: Flow): Flow = noImpl() +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogue of 'combineLatest' is 'combine'", @@ -362,6 +363,7 @@ public fun Flow.concatWith(other: Flow): Flow = noImpl() public fun Flow.combineLatest(other: Flow, transform: suspend (T1, T2) -> R): Flow = combine(this, other, transform) +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogue of 'combineLatest' is 'combine'", @@ -373,6 +375,7 @@ public fun Flow.combineLatest( transform: suspend (T1, T2, T3) -> R ) = combine(this, other, other2, transform) +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogue of 'combineLatest' is 'combine'", @@ -385,6 +388,7 @@ public fun Flow.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'", @@ -422,6 +426,7 @@ public fun Flow.delayFlow(timeMillis: Long): Flow = onStart { delay(ti ) public fun Flow.delayEach(timeMillis: Long): Flow = onEach { delay(timeMillis) } +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogues of 'switchMap' are 'transformLatest', 'flatMapLatest' and 'mapLatest'", @@ -429,6 +434,7 @@ public fun Flow.delayEach(timeMillis: Long): Flow = onEach { delay(tim ) public fun Flow.switchMap(transform: suspend (value: T) -> Flow): Flow = 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", @@ -436,6 +442,7 @@ public fun Flow.switchMap(transform: suspend (value: T) -> Flow): F ) public fun Flow.scanReduce(operation: suspend (accumulator: T, value: T) -> T): Flow = runningReduce(operation) +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogue of 'publish()' is 'shareIn'. \n" + @@ -446,6 +453,7 @@ public fun Flow.scanReduce(operation: suspend (accumulator: T, value: T) ) public fun Flow.publish(): Flow = noImpl() +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogue of 'publish(bufferSize)' is 'buffer' followed by 'shareIn'. \n" + @@ -456,6 +464,7 @@ public fun Flow.publish(): Flow = noImpl() ) public fun Flow.publish(bufferSize: Int): Flow = noImpl() +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogue of 'replay()' is 'shareIn' with unlimited replay. \n" + @@ -466,6 +475,7 @@ public fun Flow.publish(bufferSize: Int): Flow = noImpl() ) public fun Flow.replay(): Flow = noImpl() +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogue of 'replay(bufferSize)' is 'shareIn' with the specified replay parameter. \n" + @@ -476,6 +486,7 @@ public fun Flow.replay(): Flow = noImpl() ) public fun Flow.replay(bufferSize: Int): Flow = noImpl() +/** @suppress */ @Deprecated( level = DeprecationLevel.ERROR, message = "Flow analogue of 'cache()' is 'shareIn' with unlimited replay and 'started = SharingStared.Lazily' argument'", From 6bd2815d5393090bc9147b60fd385cc834d71848 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Mon, 29 Nov 2021 12:51:59 +0300 Subject: [PATCH 4/4] Update buildSrc/build.gradle.kts Co-authored-by: dkhalanskyjb <52952525+dkhalanskyjb@users.noreply.github.com> --- buildSrc/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 60a4029efe..9e7002d34d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -59,5 +59,5 @@ dependencies { 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 implementation("ru.vyarus:gradle-animalsniffer-plugin:1.5.3") // Android API check + implementation("ru.vyarus:gradle-animalsniffer-plugin:1.5.3") // Android API check }