Skip to content

Commit c9830c0

Browse files
authored
misc: upgrade to Kotlin 2.0.0 (#1105)
1 parent 8351ac1 commit c9830c0

File tree

48 files changed

+392
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+392
-235
lines changed

.brazil.json

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
{
22
"dependencies": {
3-
"com.squareup.okhttp3:okhttp-coroutines-jvm:5.*": "OkHttp3CoroutinesJvm-5.x",
3+
"org.jetbrains.kotlin:kotlin-stdlib-common:2.0.*": "KotlinStdlibCommon-2.x",
4+
"org.jetbrains.kotlin:kotlin-stdlib:2.0.*": "KotlinStdlib-2.x",
5+
"org.jetbrains.kotlinx:atomicfu:0.*.*": "Atomicfu-0.x",
6+
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.*": "KotlinxCoroutinesCoreJvm-1.8.x",
7+
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.*": "KotlinxCoroutinesCore-1.8.x",
8+
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.8.*": "KotlinxCoroutinesJdk8-1.8.x",
9+
410
"com.squareup.okhttp3:okhttp-coroutines:5.*": "OkHttp3Coroutines-5.x",
5-
"com.squareup.okhttp3:okhttp-jvm:5.*": "OkHttp3Jvm-5.x",
611
"com.squareup.okhttp3:okhttp:5.*": "OkHttp3-5.x",
712
"com.squareup.okio:okio-jvm:3.*": "OkioJvm-3.x",
813
"com.squareup.okio:okio:3.*": "Okio-3.x",
914
"io.opentelemetry:opentelemetry-api:1.*": "Maven-io-opentelemetry_opentelemetry-api-1.x",
10-
"org.jetbrains.kotlin:kotlin-stdlib-common:1.9.*": "KotlinStdlibCommon-1.9.x",
11-
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.*": "KotlinStdlibJdk8-1.9.x",
12-
"org.jetbrains.kotlin:kotlin-stdlib:1.9.*": "KotlinStdlib-1.9.x",
13-
"org.jetbrains.kotlinx:atomicfu-jvm:0.23.1": "AtomicfuJvm-0.23.1",
14-
"org.jetbrains.kotlinx:atomicfu:0.23.1": "Atomicfu-0.23.1",
15-
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.*": "KotlinxCoroutinesCoreJvm-1.7.x",
16-
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.*": "KotlinxCoroutinesCore-1.7.x",
17-
"org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.7.*": "KotlinxCoroutinesJdk8-1.7.x",
1815
"org.slf4j:slf4j-api:2.*": "Maven-org-slf4j_slf4j-api-2.x",
1916
"software.amazon.awssdk.crt:aws-crt:0.*": "Aws-crt-java-1.0.x",
2017
"aws.sdk.kotlin.crt:aws-crt-kotlin:0.8.*": "AwsCrtKotlin-0.8.x"
@@ -39,27 +36,28 @@
3936
"aws.smithy.kotlin:version-catalog"
4037
],
4138
"resolvesConflictDependencies": {
42-
"com.squareup.okhttp3:okhttp-coroutines-jvm:5.*": [
43-
"KotlinStdlibCommon-1.9.x",
44-
"KotlinStdlib-1.9.x",
45-
"KotlinxCoroutinesCoreJvm-1.7.x"
46-
],
4739
"com.squareup.okhttp3:okhttp-coroutines:5.*": [
48-
"KotlinStdlibCommon-1.9.x",
49-
"KotlinStdlib-1.9.x",
50-
"KotlinxCoroutinesCoreJvm-1.7.x"
51-
],
52-
"com.squareup.okhttp3:okhttp-jvm:5.*": [
53-
"KotlinStdlibCommon-1.9.x",
54-
"KotlinStdlib-1.9.x"
40+
"KotlinStdlib-2.x",
41+
"KotlinxCoroutinesCoreJvm-1.8.x",
42+
"KotlinStdlibJdk7-2.x",
43+
"KotlinStdlibJdk8-2.x"
5544
],
5645
"com.squareup.okhttp3:okhttp:5.*": [
57-
"KotlinStdlibCommon-1.9.x",
58-
"KotlinStdlib-1.9.x"
46+
"KotlinStdlib-2.x"
5947
],
6048
"com.squareup.okio:okio-jvm:3.*": [
61-
"KotlinStdlibCommon-1.9.x",
62-
"KotlinStdlibJdk8-1.9.x"
49+
"KotlinStdlib-2.x"
50+
],
51+
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.*": [
52+
"KotlinxCoroutinesCoreJvm-1.8.x",
53+
"KotlinStdlib-2.x"
54+
],
55+
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.*": [
56+
"KotlinxCoroutinesCoreJvm-1.8.x",
57+
"KotlinStdlib-2.x"
58+
],
59+
"org.jetbrains.kotlin:kotlin-stdlib:2.*": [
60+
"KotlinStdlib-2.x"
6361
],
6462
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.*": [
6563
"KotlinStdlibCommon-1.9.x",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": "a44842e7-3418-48ce-b2a9-99718c72c43b",
3+
"type": "misc",
4+
"description": "⚠️ **IMPORTANT**: Upgrade to Kotlin 2.0.0",
5+
"requiresMinorVersionBump": true
6+
}

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ jobs:
6060
- name: Test
6161
shell: bash
6262
run: |
63-
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
63+
# FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532
64+
# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
6465
./gradlew apiCheck
6566
./gradlew test jvmTest
6667
- name: Save Test Reports

codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/core/KotlinDependency.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private fun getDefaultRuntimeVersion(): String {
3737
// publishing info
3838
const val RUNTIME_GROUP: String = "aws.smithy.kotlin"
3939
val RUNTIME_VERSION: String = System.getProperty("smithy.kotlin.codegen.clientRuntimeVersion", getDefaultRuntimeVersion())
40-
val KOTLIN_COMPILER_VERSION: String = System.getProperty("smithy.kotlin.codegen.kotlinCompilerVersion", "1.9.21")
40+
val KOTLIN_COMPILER_VERSION: String = System.getProperty("smithy.kotlin.codegen.kotlinCompilerVersion", "2.0.0")
4141

4242
enum class SourceSet {
4343
CommonMain,

gradle/libs.versions.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[versions]
2-
kotlin-version = "1.9.23"
2+
kotlin-version = "2.0.0"
33
dokka-version = "1.9.10"
44

55
aws-kotlin-repo-tools-version = "0.4.9"
66

77
# libs
8-
coroutines-version = "1.7.3"
9-
atomicfu-version = "0.23.1"
8+
coroutines-version = "1.8.1"
9+
atomicfu-version = "0.24.0"
1010
okhttp-version = "5.0.0-alpha.14"
1111
okio-version = "3.9.0"
1212
otel-version = "1.32.0"
@@ -21,16 +21,14 @@ smithy-gradle-version = "0.9.0"
2121
# testing
2222
junit-version = "5.10.1"
2323
kotest-version = "5.8.0"
24-
kotlin-compile-testing-version = "1.5.0"
24+
kotlin-compile-testing-version = "1.6.0"
2525
kotlinx-benchmark-version = "0.4.9"
2626
kotlinx-serialization-version = "1.6.0"
2727
docker-java-version = "3.3.6"
2828
ktor-version = "2.3.12"
2929
kaml-version = "0.55.0"
3030
jsoup-version = "1.16.2"
3131

32-
33-
3432
[libraries]
3533
aws-kotlin-repo-tools-build-support = { module="aws.sdk.kotlin.gradle:build-support", version.ref = "aws-kotlin-repo-tools-version" }
3634

runtime/observability/telemetry-api/common/src/aws/smithy/kotlin/runtime/telemetry/context/TelemetryContextElement.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ public expect class TelemetryContextElement(context: Context) : CoroutineContext
1717
public companion object Key : CoroutineContext.Key<TelemetryContextElement>
1818

1919
public val context: Context
20+
override val key: CoroutineContext.Key<*>
21+
override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
22+
override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
23+
override fun plus(context: CoroutineContext): CoroutineContext
24+
override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
2025
}
2126

2227
/**

runtime/protocol/http-client-engines/test-suite/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ val startTestServers = task<LocalTestServers>("startTestServers") {
105105

106106
main = "aws.smithy.kotlin.runtime.http.test.util.TestServersKt"
107107
val kotlinCompilation = kotlin.targets.getByName("jvm").compilations["test"]
108-
classpath = (kotlinCompilation as org.jetbrains.kotlin.gradle.plugin.KotlinCompilationToRunnableFiles<*>).runtimeDependencyFiles
108+
classpath = kotlinCompilation.runtimeDependencyFiles!!
109109
sslConfigPath = File.createTempFile("ssl-", ".cfg").absolutePath
110110
}
111111

runtime/protocol/http-client-engines/test-suite/jvmAndNative/src/aws/smithy/kotlin/runtime/http/test/util/AbstractEngineTestJvmAndNative.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
package aws.smithy.kotlin.runtime.http.test.util
77

8-
import kotlinx.coroutines.CoroutineScope
9-
import kotlinx.coroutines.runBlocking
10-
import kotlinx.coroutines.withTimeout
8+
import kotlinx.coroutines.*
119
import kotlin.coroutines.CoroutineContext
1210
import kotlin.time.Duration
1311

runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/MutableMultiMap.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public interface MutableMultiMap<K, V> : MutableMap<K, MutableList<V>> {
9090
* @param value The value to disassociate
9191
* @return True if the given value was previously associated with the given key; otherwise, false.
9292
*/
93-
@Suppress("INAPPLICABLE_JVM_NAME")
93+
@Suppress("INAPPLICABLE_JVM_NAME") // https://youtrack.jetbrains.com/issue/KT-68532
9494
@JvmName("removeElement")
9595
public fun remove(key: K, value: V): Boolean
9696

@@ -170,7 +170,7 @@ internal class SimpleMutableMultiMap<K, V>(
170170

171171
override fun hashCode(): Int = delegate.hashCode()
172172

173-
@Suppress("INAPPLICABLE_JVM_NAME")
173+
@Suppress("INAPPLICABLE_JVM_NAME") // https://youtrack.jetbrains.com/issue/KT-68532
174174
@JvmName("removeElement")
175175
override fun remove(key: K, value: V): Boolean = this[key]?.remove(value) ?: false
176176

runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/views/MutableMultiMapView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ internal class MutableMultiMapView<KSrc, KDest, VSrc, VDest>(
8989
}
9090
override fun remove(key: KDest): MutableList<VDest>? = src.remove(kDest2Src(key))?.let(vListSrc2Dest)
9191

92-
@Suppress("INAPPLICABLE_JVM_NAME")
92+
@Suppress("INAPPLICABLE_JVM_NAME") // https://youtrack.jetbrains.com/issue/KT-68532
9393
@JvmName("removeElement")
9494
override fun remove(key: KDest, value: VDest): Boolean = src.remove(kDest2Src(key), vDest2Src(value))
9595

0 commit comments

Comments
 (0)