kotest-intellij-plugin
kotest-intellij-plugin copied to clipboard
K2 plugin migration
Evident usages of K1 api (resolve) are migrated
@akozlova, could you please have a look at the test failures? There seems to be some Java version 17 vs 11 mismatch.
Thanks for your work @akozlova!
i just wanted to report that I built the plugin locally (I commented everything but IC-242, because that's what I'm using, and also added kotlin.stdlib.default.dependency = false to gradle.properties because there was a warning about it. Not sure if that was necessary though).
It seems to work fine with IU-242.23339.11 in K2 Mode!
Incidentally, I got the same error about IC-243 as in the last pipeline run before I commented it, so this issue is probably real.
I am sorry, which warning? Unfortunately I see compilation errors due to 2.1.0 used to compile new 243 builds and I can't fix it locally for now :/
The warning was:
[org.jetbrains.intellij.platform] The following plugin configuration issues were found:
- 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 given link mentions to add kotlin.stdlib.default.dependency = false to gradle.properties, which makes the warning go away.
It is unrelated to the 243 issue I believe.
With the following changes I could build 242 and 243 locally:
From 9cb825461f8848c0820c8341c07b1e179ecaa347 Mon Sep 17 00:00:00 2001
From: Paul Schyska <[email protected]>
Date: Thu, 17 Oct 2024 17:52:25 +0200
Subject: [PATCH] Bump kotlin to 2.0.21, don't ignore kotlinx-coroutines
dependencies
---
build.gradle.kts | 10 +++++-----
gradle.properties | 2 ++
gradle/libs.versions.toml | 2 +-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/build.gradle.kts b/build.gradle.kts
index 19e28da..933ce47 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -172,11 +172,11 @@ dependencies {
}
configurations.all {
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-jdk8")
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test")
- exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test-jvm")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-jdk8")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test")
+ // exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-test-jvm")
}
sourceSets {
diff --git a/gradle.properties b/gradle.properties
index b571e4f..f9f6c6b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,3 +6,5 @@ version=1.1.0
org.gradle.caching=true
sandbox = /tmp/
+
+kotlin.stdlib.default.dependency = false
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 550808d..d395689 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,5 +1,5 @@
[versions]
-kotlin = "1.9.25"
+kotlin = "2.0.21"
runtime-kotest = "4.2.0"
# We separate these from the actual runtime dependencies
test-kotest = "5.9.1"
--
2.46.1
This updates kotlin to 2.0.21, and un-excludes kotlinx-coroutines dependencies. I don't know why they were excluded in the first place though, so this might wrong. I then ran:
PRODUCT_NAME=IC-243 JVM_TARGET=21 ./gradlew buildPlugin
PRODUCT_NAME=IC-242 JVM_TARGET=21 ./gradlew buildPlugin
and it built.
I don't have any intellij plugin experience, but maybe this helps you 😄
Exclusion was done to avoid conflicts on runtime during running tests. 243 bundles patched version of coroutines and then it leads to exceptions like
ERROR: 'java.lang.Object kotlinx.coroutines.BuildersKt.runBlockingWithParallelismCompensation(kotlin.coroutines.CoroutineContext, kotlin.jvm.functions.Function2)'
java.lang.NoSuchMethodError: 'java.lang.Object kotlinx.coroutines.BuildersKt.runBlockingWithParallelismCompensation(kotlin.coroutines.CoroutineContext, kotlin.jvm.functions.Function2)'
at kotlinx.coroutines.internal.intellij.IntellijCoroutines.runBlockingWithParallelismCompensation(intellij.kt:41)
at com.intellij.openapi.progress.CoroutinesKt.runBlockingCancellable$lambda$0(coroutines.kt:146)
at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:85)
at com.intellij.openapi.progress.CoroutinesKt.runBlockingCancellable(coroutines.kt:139)
at com.intellij.openapi.progress.CoroutinesKt.runBlockingMaybeCancellable(coroutines.kt:175)
at com.intellij.openapi.project.DumbServiceImpl.ensureInitialDumbTaskRequiredForSmartModeSubmitted(DumbServiceImpl.kt:702)
at com.intellij.testFramework.IndexingTestUtil.shouldWait(IndexingTestUtil.kt:94)
But the idea is actually good, many thanks! I think, just excluding on runtime should do the trick.
@sksamuel or @Kantis could you please have a look as well? I'm not familiar with the IntelliJ plugin API.
This updates kotlin to 2.0.21, and un-excludes kotlinx-coroutines dependencies. I don't know why they were excluded in the first place though, so this might wrong. I then ran:
PRODUCT_NAME=IC-243 JVM_TARGET=21 ./gradlew buildPlugin PRODUCT_NAME=IC-242 JVM_TARGET=21 ./gradlew buildPluginand it built.
I don't have any intellij plugin experience, but maybe this helps you 😄
They were excluded because otherwise there's a clash (or was, maybe excluding kotlin itself avoids that).
We are going to release IJ 2024.3 in less than a month. K2 Mode won't be enabled by default but it would be really helpful to have the plugin ready. If there is something I can do, please let me know.
@sksamuel as you've already approved, is there anything blocking the merge?
Merged. Will test and release .