Skip to content

Bump kotlin from 2.0.0 to 2.0.20 #4835

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
26 changes: 19 additions & 7 deletions buildSrc/src/main/kotlin/toolkit-intellij-subplugin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ sourceSets {

configurations {
runtimeClasspath {
// IDE provides Kotlin
// Exclude dependencies that ship with IDE
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")

Expand All @@ -41,6 +42,23 @@ configurations {
exclude(group = "com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml")
}

listOf(
"testRuntimeClasspath",
"integrationTestRuntimeClasspath",
).forEach {
try {
it {
// Exclude dependencies that ship with IDE
exclude(group = "org.slf4j")
// we want kotlinx-coroutines-debug and kotlinx-coroutines-test
exclude(group = "org.jetbrains.kotlinx", "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", "kotlinx-coroutines-core")
}
} catch (e: Exception){
logger.info("Skipped excluding IDE deps for $it because hit $e")
}
}

configureEach {
// IDE provides netty
exclude("io.netty")
Expand All @@ -49,12 +67,6 @@ configurations {
return@configureEach
}

// Exclude dependencies that ship with iDE
exclude(group = "org.slf4j")
// we want kotlinx-coroutines-debug and kotlinx-coroutines-test
exclude(group = "org.jetbrains.kotlinx", "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", "kotlinx-coroutines-core")

resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlinx" && requested.name.startsWith("kotlinx-coroutines")) {
useVersion(versionCatalog.findVersion("kotlinCoroutines").get().toString())
Expand Down
12 changes: 3 additions & 9 deletions buildSrc/src/main/kotlin/toolkit-kotlin-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import io.gitlab.arturbosch.detekt.DetektPlugin
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension

// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

plugins {
id("java-library")
id("toolkit-detekt")
Expand All @@ -15,12 +15,6 @@ plugins {
// TODO: https://github.com/gradle/gradle/issues/15383
val versionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")
dependencies {
// kotlin/kotlin-coroutines might not be necessary if we're in an intellij-plugin-based module
// - The dependency on the Kotlin Standard Library (stdlib) is automatically added when using the Gradle Kotlin plugin and may conflict with the version provided with the IntelliJ Platform, see: https://jb.gg/intellij-platform-kotlin-stdlib
//- The Kotlin Coroutines library should not be added explicitly to the project as it is already provided with the IntelliJ Platform.
implementation(versionCatalog.findBundle("kotlin").get())
implementation(versionCatalog.findLibrary("kotlin-coroutines").get())

testFixturesApi(versionCatalog.findLibrary("kotlin-test").get())
testFixturesApi(versionCatalog.findLibrary("kotlin-coroutinesDebug").get()) {
// IDE provides JNA and results in conflicts
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ junit4 = "4.13.2"
junit5 = "5.11.0"
# https://plugins.jetbrains.com/docs/intellij/kotlin.html#adding-kotlin-support
# https://kotlinlang.org/docs/releases.html#release-details
kotlin = "2.0.0"
kotlin = "2.0.20"
# set in <root>/settings.gradle.kts
kotlinCoroutines = "1.8.0"
mockito = "5.12.0"
Expand Down Expand Up @@ -97,7 +97,7 @@ kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core",
kotlin-coroutinesDebug = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-debug", version.ref = "kotlinCoroutines" }
kotlin-coroutinesTest = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinCoroutines" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-stdLibJdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockitoKotlin" }
Expand All @@ -114,7 +114,7 @@ zjsonpatch = { module = "com.flipkart.zjsonpatch:zjsonpatch", version.ref = "zjs

[bundles]
jackson = ["jackson-datetime", "jackson-kotlin", "jackson-yaml", "jackson-xml"]
kotlin = ["kotlin-stdLibJdk8", "kotlin-reflect"]
kotlin = ["kotlin-stdlib", "kotlin-reflect"]
mockito = ["mockito-core", "mockito-kotlin"]
sshd = ["sshd-core", "sshd-scp", "sshd-sftp"]

Expand Down
4 changes: 4 additions & 0 deletions plugins/core/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ plugins {
}

dependencies {
// provided at runtime by IDE
compileOnly(libs.bundles.kotlin)
compileOnly(libs.kotlin.coroutines)

compileOnlyApi(project(":plugin-core:resources"))
compileOnlyApi(project(":plugin-core:sdk-codegen"))

Expand Down
2 changes: 2 additions & 0 deletions plugins/core/resources/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ sourceSets {
}

dependencies {
implementation(libs.bundles.kotlin)

testImplementation(libs.junit4)
testRuntimeOnly(libs.junit5.jupiterVintage)
}
Expand Down
2 changes: 0 additions & 2 deletions plugins/toolkit/jetbrains-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ dependencies {
compileOnlyApi(project(":plugin-core:core"))
compileOnlyApi(project(":plugin-core:jetbrains-community"))

// TODO: remove Q dependency when split is fully done
implementation(libs.bundles.jackson)
implementation(libs.zjsonpatch)

testFixturesApi(testFixtures(project(":plugin-core:jetbrains-community")))
Expand Down
11 changes: 0 additions & 11 deletions plugins/toolkit/jetbrains-rider/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,3 @@ tasks.integrationTest {
tasks.withType<DetektCreateBaselineTask>().configureEach {
dependsOn(generateModels)
}

configurations.all {
if (name.contains("detekt")) {
return@all
}

// test runner not happy with coroutines, but not clear where it's coming from:
// java.lang.Throwable: Thread context was already set: InstalledThreadContext(snapshot=null, context=EmptyCoroutineContext).
// Most likely, you are using 'runBlocking' instead of 'runBlockingCancellable' somewhere in the asynchronous stack.
exclude("org.jetbrains.kotlinx")
}
Loading