Skip to content

Commit 18ccfe6

Browse files
committed
Update kotlin version to 1.9.20-Beta
1 parent 6d3157b commit 18ccfe6

File tree

21 files changed

+26
-198
lines changed

21 files changed

+26
-198
lines changed

build.gradle

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
1010
import org.jetbrains.kotlin.konan.target.HostManager
1111
import org.jetbrains.dokka.gradle.DokkaTaskPartial
1212

13-
import static KotlinVersion.isKotlinVersionAtLeast
1413
import static Projects.*
1514

1615
apply plugin: 'jdk-convention'
@@ -62,7 +61,7 @@ buildscript {
6261
dependencies {
6362
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
6463
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
65-
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_wasm_version"
64+
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version"
6665
classpath "org.jetbrains.kotlinx:kotlinx-knit:$knit_version"
6766
classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$binary_compatibility_validator_version"
6867
classpath "ru.vyarus:gradle-animalsniffer-plugin:1.5.4" // Android API check
@@ -164,14 +163,7 @@ configure(subprojects.findAll { !sourceless.contains(it.name) && it.name != core
164163

165164
apply from: rootProject.file("gradle/compile-js-multiplatform.gradle")
166165

167-
// TODO: Wasm target names have been changed since 1.9.20, remove this after migration to 1.9.20 (issue 3846)
168-
// https://github.com/Kotlin/kotlinx.coroutines/issues/3846
169-
def isNewWasmTargetEnabled = isKotlinVersionAtLeast(ext.kotlin_version, 1, 9, 20)
170-
if (isNewWasmTargetEnabled) {
171-
apply from: rootProject.file("gradle/compile-wasm-multiplatform.gradle")
172-
} else {
173-
apply from: rootProject.file("gradle/compile-wasm-multiplatform19.gradle")
174-
}
166+
apply from: rootProject.file("gradle/compile-wasm-multiplatform.gradle")
175167

176168
kotlin.sourceSets.commonMain.dependencies {
177169
api project(":$coreModule")
@@ -384,17 +376,6 @@ if (CacheRedirector.enabled) {
384376
}
385377
}
386378

387-
// This is bootstrap atomicFU version with wasm support, remove it as regular atomic-fu will be published
388-
allprojects {
389-
configurations.all {
390-
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
391-
if (details.requested.name == 'atomicfu-wasm') {
392-
details.useVersion atomicfu_wasm_version
393-
}
394-
}
395-
}
396-
}
397-
398379
// Update node version to support latest wasm engine
399380
extensions.findByType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension.class).with {
400381
it.nodeVersion = "20.2.0"

buildSrc/src/main/kotlin/KotlinVersion.kt

Lines changed: 0 additions & 14 deletions
This file was deleted.

gradle.properties

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
# Kotlin
66
version=1.7.2-SNAPSHOT
77
group=org.jetbrains.kotlinx
8-
kotlin_version=1.9.0
8+
kotlin_version=1.9.20-Beta
99

1010
# Dependencies
1111
junit_version=4.12
1212
junit5_version=5.7.0
13-
atomicfu_version=0.22.0
14-
# This is bootstrap atomicFU version with wasm support, remove it as regular atomic-fu will be published
15-
atomicfu_wasm_version=0.21.0-wasm0
13+
# TODO: Update version as regular atomic-fu will be published
14+
atomicfu_version=0.22.0-wasm1
1615
knit_version=0.4.0
1716
html_version=0.7.2
1817
lincheck_version=2.18.1

gradle/compile-native-multiplatform.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
import static KotlinVersion.isKotlinVersionAtLeast
2-
31
/*
42
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
53
*/
64

75
project.ext.nativeMainSets = []
86
project.ext.nativeTestSets = []
97

10-
// TODO: this block should be removed when Kotlin version is updated to 1.9.20
11-
// Right now it is used for conditional removal of native targets that will be removed in 1.9.20 (iosArm32, watchosX86)
12-
// and is necessary for testing of Kotlin dev builds.
13-
def enableDeprecatedNativeTargets = !isKotlinVersionAtLeast(ext.kotlin_version, 1, 9, 20)
14-
158
kotlin {
169
targets {
1710
delegate.metaClass.addTarget = { preset ->
@@ -48,12 +41,6 @@ kotlin {
4841
addTarget(presets.androidNativeX64)
4942
addTarget(presets.mingwX64)
5043
addTarget(presets.watchosDeviceArm64)
51-
52-
// Deprecated, but were provided by coroutine; can be removed only when K/N drops the target
53-
if (enableDeprecatedNativeTargets) {
54-
addTarget(presets.iosArm32)
55-
addTarget(presets.watchosX86)
56-
}
5744
}
5845

5946
sourceSets {

gradle/compile-wasm-multiplatform.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ kotlin {
1515
wasmJsMain {
1616
kotlin {
1717
srcDir 'jsAndWasmShared/src'
18-
srcDir 'wasmJs/src'
1918
}
2019
}
2120
wasmJsTest {
2221
kotlin {
2322
srcDir 'jsAndWasmShared/test'
24-
srcDir 'wasmJs/test'
2523
}
2624
}
2725
wasmJsTest.dependencies {

gradle/compile-wasm-multiplatform19.gradle

Lines changed: 0 additions & 31 deletions
This file was deleted.

gradle/dokka.gradle.kts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,8 @@ if (project.name == "kotlinx-coroutines-core") {
6767
makeLinkMapping(project.file("jvm"))
6868
}
6969

70-
val isNewWasmTargetEnabled = isKotlinVersionAtLeast(kotlin_version, 1, 9, 20)
71-
if (isNewWasmTargetEnabled) {
72-
val wasmJsMain by getting {
73-
makeLinkMapping(project.file("wasm"))
74-
}
75-
} else {
76-
val wasmMain by getting {
77-
makeLinkMapping(project.file("wasm"))
78-
}
70+
val wasmJsMain by getting {
71+
makeLinkMapping(project.file("wasm"))
7972
}
8073
}
8174
}

integration-testing/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
kotlin_version=1.9.0
1+
kotlin_version=1.9.20-Beta
22
coroutines_version=1.7.2-SNAPSHOT
33
asm_version=9.3
44

integration-testing/smokeTest/build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,6 @@ kotlin {
6060
}
6161
}
6262

63-
// This is bootstrap atomicFU version with wasm support, remove it as regular atomic-fu will be published
64-
allprojects {
65-
configurations.all {
66-
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
67-
if (details.requested.name == 'atomicfu-wasm') {
68-
details.useVersion '0.21.0-wasm0'
69-
}
70-
}
71-
}
72-
}
73-
7463
// Update node version to support latest wasm engine
7564
rootProject.extensions.findByType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension.class).with {
7665
it.nodeVersion = "20.2.0"

kotlinx-coroutines-core/build.gradle

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
2-
import static KotlinVersion.isKotlinVersionAtLeast
3-
41
/*
52
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
63
*/
@@ -20,14 +17,7 @@ if (rootProject.ext.native_targets_enabled) {
2017

2118
apply from: rootProject.file("gradle/compile-js-multiplatform.gradle")
2219

23-
// TODO: Wasm target names have been changed since 1.9.20, remove this after migration to 1.9.20 (issue 3846)
24-
// https://github.com/Kotlin/kotlinx.coroutines/issues/3846
25-
def isNewWasmTargetEnabled = isKotlinVersionAtLeast(ext.kotlin_version, 1, 9, 20)
26-
if (isNewWasmTargetEnabled) {
27-
apply from: rootProject.file("gradle/compile-wasm-multiplatform.gradle")
28-
} else {
29-
apply from: rootProject.file("gradle/compile-wasm-multiplatform19.gradle")
30-
}
20+
apply from: rootProject.file("gradle/compile-wasm-multiplatform.gradle")
3121

3222
apply from: rootProject.file('gradle/dokka.gradle.kts')
3323
apply from: rootProject.file('gradle/publish.gradle')

kotlinx-coroutines-core/concurrent/src/CompletionHandler.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@ package kotlinx.coroutines
66

77
import kotlinx.coroutines.internal.*
88

9-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
109
// New 'CompletionHandler` supertype is added compared to the expect declaration.
1110
// Probably we can add it to JS and common too, to avoid the suppression/opt-in
12-
@Suppress("ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_SUPERTYPES_AS_NON_FINAL_EXPECT_CLASSIFIER")
11+
@AllowDifferentMembersInActual
1312
internal actual abstract class CompletionHandlerBase actual constructor() : LockFreeLinkedListNode(), CompletionHandler {
1413
actual abstract override fun invoke(cause: Throwable?)
1514
}
1615

1716
internal actual inline val CompletionHandlerBase.asHandler: CompletionHandler get() = this
1817

19-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
2018
// New 'CompletionHandler` supertype is added compared to the expect declaration.
2119
// Probably we can add it to JS and common too, to avoid the suppression/opt-in
22-
@Suppress("ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_SUPERTYPES_AS_NON_FINAL_EXPECT_CLASSIFIER")
20+
@AllowDifferentMembersInActual
2321
internal actual abstract class CancelHandlerBase actual constructor() : CompletionHandler {
2422
actual abstract override fun invoke(cause: Throwable?)
2523
}

kotlinx-coroutines-core/concurrent/src/internal/LockFreeLinkedList.kt

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ internal val CONDITION_FALSE: Any = Symbol("CONDITION_FALSE")
4444
*/
4545
@Suppress(
4646
"LeakingThis",
47-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
48-
"ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER"
4947
)
5048
@InternalCoroutinesApi
49+
@AllowDifferentMembersInActual
5150
public actual open class LockFreeLinkedListNode {
5251
private val _next = atomic<Any>(this) // Node | Removed | OpDescriptor
5352
private val _prev = atomic(this) // Node to the left (cannot be marked as removed)
@@ -57,6 +56,7 @@ public actual open class LockFreeLinkedListNode {
5756
_removedRef.value ?: Removed(this).also { _removedRef.lazySet(it) }
5857

5958
@PublishedApi
59+
@AllowDifferentMembersInActual
6060
internal abstract class CondAddOp(
6161
@JvmField val newNode: Node
6262
) : AtomicOp<Node>() {
@@ -72,20 +72,14 @@ public actual open class LockFreeLinkedListNode {
7272
}
7373
}
7474

75-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
76-
@Suppress("NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION")
7775
@PublishedApi
7876
internal inline fun makeCondAddOp(node: Node, crossinline condition: () -> Boolean): CondAddOp =
7977
object : CondAddOp(node) {
8078
override fun prepare(affected: Node): Any? = if (condition()) null else CONDITION_FALSE
8179
}
8280

83-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
84-
@Suppress("MODALITY_CHANGED_IN_NON_FINAL_EXPECT_CLASSIFIER_ACTUALIZATION")
8581
public actual open val isRemoved: Boolean get() = next is Removed
8682

87-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
88-
@Suppress("NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION")
8983
// LINEARIZABLE. Returns Node | Removed
9084
public val next: Any get() {
9185
_next.loop { next ->
@@ -176,8 +170,6 @@ public actual open class LockFreeLinkedListNode {
176170
* Where `==>` denotes linearization point.
177171
* Returns `false` if `next` was not following `this` node.
178172
*/
179-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
180-
@Suppress("NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION")
181173
@PublishedApi
182174
internal fun addNext(node: Node, next: Node): Boolean {
183175
node._prev.lazySet(this)
@@ -188,8 +180,6 @@ public actual open class LockFreeLinkedListNode {
188180
return true
189181
}
190182

191-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
192-
@Suppress("NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION")
193183
// returns UNDECIDED, SUCCESS or FAILURE
194184
@PublishedApi
195185
internal fun tryCondAddNext(node: Node, next: Node, condAdd: CondAddOp): Int {
@@ -213,8 +203,6 @@ public actual open class LockFreeLinkedListNode {
213203
public actual open fun remove(): Boolean =
214204
removeOrNext() == null
215205

216-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
217-
@Suppress("NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION")
218206
// returns null if removed successfully or next node if this node is already removed
219207
@PublishedApi
220208
internal fun removeOrNext(): Node? {
@@ -271,8 +259,6 @@ public actual open class LockFreeLinkedListNode {
271259
}
272260
}
273261

274-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
275-
@Suppress("NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION")
276262
protected open fun nextIfRemoved(): Node? = (next as? Removed)?.ref
277263

278264
/**
@@ -329,8 +315,6 @@ public actual open class LockFreeLinkedListNode {
329315
}
330316
}
331317

332-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
333-
@Suppress("NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION")
334318
internal fun validateNode(prev: Node, next: Node) {
335319
assert { prev === this._prev.value }
336320
assert { next === this._next.value }
@@ -351,8 +335,7 @@ internal fun Any.unwrap(): Node = (this as? Removed)?.ref ?: this as Node
351335
*
352336
* @suppress **This is unstable API and it is subject to change.**
353337
*/
354-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
355-
@Suppress("ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER")
338+
@AllowDifferentMembersInActual
356339
public actual open class LockFreeLinkedListHead : LockFreeLinkedListNode() {
357340
public actual val isEmpty: Boolean get() = next === this
358341

@@ -374,8 +357,6 @@ public actual open class LockFreeLinkedListHead : LockFreeLinkedListNode() {
374357
override val isRemoved: Boolean get() = false
375358
override fun nextIfRemoved(): Node? = null
376359

377-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
378-
@Suppress("NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION")
379360
internal fun validate() {
380361
var prev: Node = this
381362
var cur: Node = next as Node

kotlinx-coroutines-core/jsAndWasmShared/src/internal/LinkedList.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,7 @@ import kotlinx.coroutines.*
1010

1111
private typealias Node = LinkedListNode
1212
/** @suppress **This is unstable API and it is subject to change.** */
13-
@Suppress(
14-
// :TODO: Remove when fixed: https://youtrack.jetbrains.com/issue/KT-23703
15-
"NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS",
16-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
17-
"ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER",
18-
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
19-
"ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_SUPERTYPES_AS_NON_FINAL_EXPECT_CLASSIFIER"
20-
)
13+
@AllowDifferentMembersInActual
2114
public actual typealias LockFreeLinkedListNode = LinkedListNode
2215

2316
/** @suppress **This is unstable API and it is subject to change.** */

kotlinx-coroutines-core/jsAndWasmShared/src/internal/Synchronized.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import kotlinx.coroutines.*
1010
* @suppress **This an internal API and should not be used from general code.**
1111
*/
1212
@InternalCoroutinesApi
13+
@Suppress("ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER")
1314
public actual typealias SynchronizedObject = Any
1415

1516
/**

0 commit comments

Comments
 (0)