Skip to content

Commit 8cdc2a1

Browse files
mustard-mhroboquat
andauthored
[JetBrains] Make backend-plugin compatible with 2025.2 (#20871)
* Update Platform Version of JetBrains Backend Plugin (EAP) to * 1 * Fix * Add test cases back * Fix stable build * Fix build * Fix rider latest build --------- Co-authored-by: Robo Quat <roboquat@gitpod.io>
1 parent f1dc3a5 commit 8cdc2a1

File tree

6 files changed

+33
-28
lines changed

6 files changed

+33
-28
lines changed

components/ide/jetbrains/backend-plugin/build.gradle-latest.kts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ plugins {
1212
// Java support
1313
id("java")
1414
// Kotlin support - check the latest version at https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
15-
id("org.jetbrains.kotlin.jvm") version "2.0.0"
15+
id("org.jetbrains.kotlin.jvm") version "2.2.0-RC"
1616
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
17-
id("org.jetbrains.intellij.platform") version "2.0.0-beta8"
17+
id("org.jetbrains.intellij.platform") version "2.6.0"
1818
// id("org.jetbrains.intellij.platform.migration") version "2.0.0-beta7"
1919
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
2020
id("io.gitlab.arturbosch.detekt") version "1.23.6"
@@ -158,7 +158,9 @@ tasks {
158158
targetCompatibility = "21"
159159
}
160160
withType<KotlinCompile> {
161-
kotlinOptions.jvmTarget = "21"
161+
compilerOptions {
162+
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
163+
}
162164
}
163165

164166
buildSearchableOptions {
@@ -175,8 +177,8 @@ tasks {
175177

176178
tasks.register("runPluginVerifier") {
177179
if (properties("platformType") == "RD") {
178-
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.Rider, properties("pluginVerifierIdeVersions"))
180+
intellijPlatform.pluginVerification.ides.ide(IntelliJPlatformType.Rider, properties("pluginVerifierIdeVersions"))
179181
} else {
180-
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
182+
intellijPlatform.pluginVerification.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
181183
}
182184
}

components/ide/jetbrains/backend-plugin/build.gradle.kts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ plugins {
1212
// Java support
1313
id("java")
1414
// Kotlin support - check the latest version at https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
15-
id("org.jetbrains.kotlin.jvm") version "2.0.0"
15+
id("org.jetbrains.kotlin.jvm") version "2.2.0-RC"
1616
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
17-
id("org.jetbrains.intellij.platform") version "2.0.0-beta8"
17+
id("org.jetbrains.intellij.platform") version "2.6.0"
1818
// id("org.jetbrains.intellij.platform.migration") version "2.0.0-beta7"
1919
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
2020
id("io.gitlab.arturbosch.detekt") version "1.23.6"
@@ -158,7 +158,9 @@ tasks {
158158
targetCompatibility = "21"
159159
}
160160
withType<KotlinCompile> {
161-
kotlinOptions.jvmTarget = "21"
161+
compilerOptions {
162+
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
163+
}
162164
}
163165

164166
buildSearchableOptions {
@@ -175,8 +177,8 @@ tasks {
175177

176178
tasks.register("runPluginVerifier") {
177179
if (properties("platformType") == "RD") {
178-
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.Rider, properties("pluginVerifierIdeVersions"))
180+
intellijPlatform.pluginVerification.ides.ide(IntelliJPlatformType.Rider, properties("pluginVerifierIdeVersions"))
179181
} else {
180-
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
182+
intellijPlatform.pluginVerification.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
181183
}
182184
}

components/ide/jetbrains/backend-plugin/gradle-latest.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
33
# for insight into build numbers and IntelliJ Platform versions.
44
# revert pluginSinceBuild if it's unnecessary
5-
pluginSinceBuild=251.17181
6-
pluginUntilBuild=251.*
5+
pluginSinceBuild=252.18003
6+
pluginUntilBuild=252.*
77
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
88
# See https://jb.gg/intellij-platform-builds-list for available build versions.
9-
pluginVerifierIdeVersions=2025.1
9+
pluginVerifierIdeVersions=2025.2
1010
# Version from "com.jetbrains.intellij.idea" which can be found at https://www.jetbrains.com/updates/updates.xml or exec `./gradlew printProductsReleases`
11-
platformVersion=251.17181.16
11+
platformVersion=252.18003.27

components/ide/jetbrains/backend-plugin/gradle-stable.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ pluginUntilBuild=251.*
88
# See https://jb.gg/intellij-platform-builds-list for available build versions.
99
pluginVerifierIdeVersions=2025.1
1010
# Version from "com.jetbrains.intellij.idea" which can be found at https://www.jetbrains.com/intellij-repository/snapshots
11-
platformVersion=251.25410-EAP-CANDIDATE-SNAPSHOT
11+
platformVersion=251.26094.98

components/ide/jetbrains/backend-plugin/src/main/kotlin/kotlinx/coroutines/guava/ListenableFuture.kt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
package kotlinx.coroutines.guava
66

77
import com.google.common.util.concurrent.*
8-
import com.google.common.util.concurrent.internal.InternalFutureFailureAccess
9-
import com.google.common.util.concurrent.internal.InternalFutures
8+
import com.google.common.util.concurrent.internal.*
109
import kotlinx.coroutines.*
1110
import java.util.concurrent.*
1211
import java.util.concurrent.CancellationException
@@ -138,10 +137,10 @@ public fun <T> ListenableFuture<T>.asDeferred(): Deferred<T> {
138137
// Finally, if this isn't done yet, attach a Listener that will complete the Deferred.
139138
val deferred = CompletableDeferred<T>()
140139
Futures.addCallback(this, object : FutureCallback<T> {
141-
override fun onSuccess(result: T?) {
140+
override fun onSuccess(result: T) {
142141
// Here we work with flexible types, so we unchecked cast to trick the type system
143142
@Suppress("UNCHECKED_CAST")
144-
runCatching { deferred.complete(result as T) }
143+
runCatching { deferred.complete(result) }
145144
.onFailure { handleCoroutineException(EmptyCoroutineContext, it) }
146145
}
147146

@@ -225,7 +224,7 @@ public fun <T> Deferred<T>.asListenableFuture(): ListenableFuture<T> {
225224
*
226225
* This suspend function is cancellable.
227226
*
228-
* If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function
227+
* If the [Job] of the current coroutine is cancelled while this suspending function is waiting, this function
229228
* stops waiting for the future and immediately resumes with [CancellationException][kotlinx.coroutines.CancellationException].
230229
*
231230
* This method is intended to be used with one-shot Futures, so on coroutine cancellation, the Future is cancelled as well.
@@ -247,8 +246,7 @@ public suspend fun <T> ListenableFuture<T>.await(): T {
247246
return suspendCancellableCoroutine { cont: CancellableContinuation<T> ->
248247
addListener(
249248
ToContinuation(this, cont),
250-
MoreExecutors.directExecutor()
251-
)
249+
MoreExecutors.directExecutor())
252250
cont.invokeOnCancellation {
253251
cancel(false)
254252
}
@@ -265,7 +263,7 @@ public suspend fun <T> ListenableFuture<T>.await(): T {
265263
private class ToContinuation<T>(
266264
val futureToObserve: ListenableFuture<T>,
267265
val continuation: CancellableContinuation<T>
268-
) : Runnable {
266+
): Runnable {
269267
override fun run() {
270268
if (futureToObserve.isCancelled) {
271269
continuation.cancel()
@@ -346,7 +344,7 @@ private class ListenableFutureCoroutine<T>(
346344
* could probably be compressed into one subclass of [AbstractFuture] to save an allocation, at the
347345
* cost of the implementation's readability.
348346
*/
349-
private class JobListenableFuture<T>(private val jobToCancel: Job) : ListenableFuture<T> {
347+
private class JobListenableFuture<T>(private val jobToCancel: Job): ListenableFuture<T> {
350348
/**
351349
* Serves as a state machine for [Future] cancellation.
352350
*
@@ -356,7 +354,7 @@ private class JobListenableFuture<T>(private val jobToCancel: Job) : ListenableF
356354
*
357355
* To preserve Coroutine's [CancellationException], this future points to either `T` or [Cancelled].
358356
*/
359-
private val auxFuture = SettableFuture.create<Any>()
357+
private val auxFuture = SettableFuture.create<Any?>()
360358

361359
/**
362360
* `true` if [auxFuture.get][ListenableFuture.get] throws [ExecutionException].
@@ -441,7 +439,7 @@ private class JobListenableFuture<T>(private val jobToCancel: Job) : ListenableF
441439
}
442440

443441
/** See [get()]. */
444-
private fun getInternal(result: Any): T = if (result is Cancelled) {
442+
private fun getInternal(result: Any?): T = if (result is Cancelled) {
445443
throw CancellationException().initCause(result.exception)
446444
} else {
447445
// We know that `auxFuture` can contain either `T` or `Cancelled`.

components/ide/jetbrains/backend-plugin/src/test/kotlin/io/gitpod/jetbrains/remote/util/LocalHostUriTest.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44

55
package io.gitpod.jetbrains.remote.util
66

7-
import com.intellij.testFramework.fixtures.BasePlatformTestCase
87
import io.gitpod.jetbrains.remote.utils.LocalHostUri
98
import io.gitpod.jetbrains.remote.utils.LocalHostUri.LocalHostUriMetadata
109
import java.net.URI
10+
import kotlin.test.Test
11+
import kotlin.test.assertEquals
12+
import kotlin.test.assertTrue
1113

12-
class LocalHostUriTest : BasePlatformTestCase() {
14+
internal class LocalHostUriTest {
15+
@Test
1316
fun testExtractLocalHostUriMetaDataForPortMapping() {
1417
val urlToMetadataMap = mapOf(
1518
"https://localhost:80" to object: LocalHostUriMetadata {

0 commit comments

Comments
 (0)