From 857190ac0e82353e5367d307619b4fdf2aa1e3e4 Mon Sep 17 00:00:00 2001 From: BoD Date: Fri, 21 Mar 2025 10:31:22 +0100 Subject: [PATCH 01/10] Bump Kotlin to 2.1.20 --- gradle/libraries.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/libraries.toml b/gradle/libraries.toml index f796496a0ed..67fb258f334 100644 --- a/gradle/libraries.toml +++ b/gradle/libraries.toml @@ -27,12 +27,12 @@ javaPoet = "1.13.0" jetbrains-annotations = "24.0.1" junit = "4.13.2" kotlin-plugin-min = "1.9.0" -kotlin-plugin = "2.1.10" -kotlin-plugin-max = "2.1.10" +kotlin-plugin = "2.1.20" +kotlin-plugin-max = "2.1.20" kotlinx-coroutines = "1.9.0" kotlinx-datetime = "0.5.0" kotlinx-serialization-runtime = "1.6.2" -ksp = "2.1.10-1.0.29" +ksp = "2.1.20-1.0.31" ktor = "3.0.0" moshix = "0.14.1" node-fetch = "2.7.0" From 4587f31c0ee3b6c6a8f8175db0676749fc2dbac4 Mon Sep 17 00:00:00 2001 From: BoD Date: Tue, 10 Dec 2024 12:10:03 +0100 Subject: [PATCH 02/10] Remove redundant when cases, reported as warnings --- .../com/apollographql/apollo/tooling/RegisterOperations.kt | 1 - .../kotlin/com/apollographql/apollo/tooling/serialization.kt | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/RegisterOperations.kt b/libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/RegisterOperations.kt index 895e29e5dd0..8616c4cd104 100644 --- a/libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/RegisterOperations.kt +++ b/libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/RegisterOperations.kt @@ -51,7 +51,6 @@ private fun GQLSelection.score(): String { is GQLField -> "a$name" is GQLFragmentSpread -> "b$name" is GQLInlineFragment -> "c" // apollo-tooling doesn't sort inline fragments - else -> error("Cannot sort Selection '$this'") } } diff --git a/libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/serialization.kt b/libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/serialization.kt index 0e97cf66bbc..7f18038d1dc 100644 --- a/libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/serialization.kt +++ b/libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/serialization.kt @@ -21,7 +21,6 @@ internal fun JsonElement.toAny(): Any? = when (this) { else -> booleanOrNull ?: intOrNull ?: longOrNull ?: doubleOrNull ?: error("cannot decode $this") } } - else -> error("cannot convert $this to Any") } fun Any?.toJsonElement(): JsonElement = when (this) { @@ -32,4 +31,4 @@ fun Any?.toJsonElement(): JsonElement = when (this) { is String -> JsonPrimitive(this) null -> JsonNull else -> error("cannot convert $this to JsonElement") -} \ No newline at end of file +} From 22c81b283d5e2d9465d76c8a7ec95d394b9dfdaf Mon Sep 17 00:00:00 2001 From: BoD Date: Tue, 10 Dec 2024 14:49:03 +0100 Subject: [PATCH 03/10] Add KotlinPlatformType.jvm attribute to apolloDependencies configuration, to fix "More than one variant of project :apollo-runtime matches the consumer attributes" Gradle error. Not entirely sure why this is now needed, but that fixes it. --- intellij-plugin/build.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/intellij-plugin/build.gradle.kts b/intellij-plugin/build.gradle.kts index 7bed6901c6f..601e39cb5b3 100644 --- a/intellij-plugin/build.gradle.kts +++ b/intellij-plugin/build.gradle.kts @@ -6,6 +6,7 @@ import org.jetbrains.intellij.platform.gradle.TestFrameworkType import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INTERNAL_API_USAGES import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INVALID_PLUGIN import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.PLUGIN_STRUCTURE_WARNINGS +import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType import java.net.URI import java.text.SimpleDateFormat import java.util.Date @@ -55,6 +56,9 @@ kotlin { } val apolloDependencies = configurations.create("apolloDependencies").apply { + attributes { + attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) + } listOf(":apollo-annotations", ":apollo-api", ":apollo-runtime").forEach { dependencies.add(project.dependencies.project(it, "jvmApiElements")) } From 2deae3dbda6f395396e2fb36290844964c070626 Mon Sep 17 00:00:00 2001 From: BoD Date: Fri, 21 Mar 2025 13:03:45 +0100 Subject: [PATCH 04/10] Give more RAM to the plugin verifier --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c242b0146e0..586d9256dad 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -167,7 +167,7 @@ jobs: - name: Run Plugin Verification tasks env: JAVA_TOOL_OPTIONS: -Dlogback.configurationFile=${{ github.workspace }}/intellij-plugin/logback.xml - run: ./gradlew :intellij-plugin:verifyPlugin -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} + run: ./gradlew -Dorg.gradle.jvmargs=-Xmx2g :intellij-plugin:verifyPlugin -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} # Collect Plugin Verifier Result - name: Collect Plugin Verifier Result From 265589ef2328cf53317946bdfc88f2ee6b2a7438 Mon Sep 17 00:00:00 2001 From: BoD Date: Fri, 21 Mar 2025 13:06:31 +0100 Subject: [PATCH 05/10] Re enable COMPATIBILITY_PROBLEMS in the plugin verifier --- intellij-plugin/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intellij-plugin/build.gradle.kts b/intellij-plugin/build.gradle.kts index 601e39cb5b3..b52e792a4b1 100644 --- a/intellij-plugin/build.gradle.kts +++ b/intellij-plugin/build.gradle.kts @@ -3,6 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent import org.jetbrains.changelog.markdownToHTML import org.jetbrains.intellij.platform.gradle.TestFrameworkType +import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.COMPATIBILITY_PROBLEMS import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INTERNAL_API_USAGES import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INVALID_PLUGIN import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.PLUGIN_STRUCTURE_WARNINGS @@ -247,8 +248,7 @@ intellijPlatform { } failureLevel.set( setOf( - // TODO: Temporarily disabled due to https://platform.jetbrains.com/t/plugin-verifier-fails-with-plugin-com-intellij-modules-json-not-declared-as-a-plugin-dependency/580 -// COMPATIBILITY_PROBLEMS, + COMPATIBILITY_PROBLEMS, INTERNAL_API_USAGES, INVALID_PLUGIN, PLUGIN_STRUCTURE_WARNINGS, From 1c83e028c5f37d009ecb0848523b3fc271d643a2 Mon Sep 17 00:00:00 2001 From: BoD Date: Fri, 21 Mar 2025 14:13:42 +0100 Subject: [PATCH 06/10] Try to give more memory to the plugin verifier --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 586d9256dad..40e983bbfc2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -166,8 +166,8 @@ jobs: # Run Verify Plugin task and IntelliJ Plugin Verifier tool - name: Run Plugin Verification tasks env: - JAVA_TOOL_OPTIONS: -Dlogback.configurationFile=${{ github.workspace }}/intellij-plugin/logback.xml - run: ./gradlew -Dorg.gradle.jvmargs=-Xmx2g :intellij-plugin:verifyPlugin -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} + JAVA_TOOL_OPTIONS: -Xmx2g -Dlogback.configurationFile=${{ github.workspace }}/intellij-plugin/logback.xml + run: ./gradlew :intellij-plugin:verifyPlugin -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} # Collect Plugin Verifier Result - name: Collect Plugin Verifier Result From 2c0ce51f872fd002f2c7dc89da34d9ba77333906 Mon Sep 17 00:00:00 2001 From: BoD Date: Fri, 21 Mar 2025 14:53:10 +0100 Subject: [PATCH 07/10] Try to give even more memory to the plugin verifier. Also lower the log level. --- .github/workflows/pr.yml | 2 +- intellij-plugin/logback.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 40e983bbfc2..88d7624af32 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -166,7 +166,7 @@ jobs: # Run Verify Plugin task and IntelliJ Plugin Verifier tool - name: Run Plugin Verification tasks env: - JAVA_TOOL_OPTIONS: -Xmx2g -Dlogback.configurationFile=${{ github.workspace }}/intellij-plugin/logback.xml + JAVA_TOOL_OPTIONS: -Xmx4g -Dlogback.configurationFile=${{ github.workspace }}/intellij-plugin/logback.xml run: ./gradlew :intellij-plugin:verifyPlugin -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} # Collect Plugin Verifier Result diff --git a/intellij-plugin/logback.xml b/intellij-plugin/logback.xml index 0075d2bc1d5..ccaa085fb5a 100644 --- a/intellij-plugin/logback.xml +++ b/intellij-plugin/logback.xml @@ -6,7 +6,7 @@ - + From 874ae669907f184fa05479a7ee2e173fc159f9ae Mon Sep 17 00:00:00 2001 From: BoD Date: Fri, 21 Mar 2025 16:07:04 +0100 Subject: [PATCH 08/10] Try using Java 24 --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 88d7624af32..5f5ee51b15e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -124,7 +124,7 @@ jobs: uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1 with: distribution: 'temurin' - java-version: 17 + java-version: 24 # Set environment variables - name: Export Properties From 1ca92ad4f55a8c2bee2de5133fef4d109119edf8 Mon Sep 17 00:00:00 2001 From: BoD Date: Fri, 21 Mar 2025 16:12:04 +0100 Subject: [PATCH 09/10] Try using Java 23 --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5f5ee51b15e..652a920e528 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -124,7 +124,7 @@ jobs: uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1 with: distribution: 'temurin' - java-version: 24 + java-version: 23 # Set environment variables - name: Export Properties From 6898443ebb31dd7205e83fd552df4e94458f3aab Mon Sep 17 00:00:00 2001 From: BoD Date: Tue, 25 Mar 2025 15:27:31 +0100 Subject: [PATCH 10/10] Revert Plugin Verifier to v1.383 due to https://youtrack.jetbrains.com/issue/MP-7366 --- intellij-plugin/build.gradle.kts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/intellij-plugin/build.gradle.kts b/intellij-plugin/build.gradle.kts index b52e792a4b1..fdc35b6deb6 100644 --- a/intellij-plugin/build.gradle.kts +++ b/intellij-plugin/build.gradle.kts @@ -1,4 +1,3 @@ - import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent import org.jetbrains.changelog.markdownToHTML @@ -165,7 +164,9 @@ dependencies { bundledPlugins(properties("platformBundledPlugins").split(',').map(String::trim).filter(String::isNotEmpty)) plugins(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty)) instrumentationTools() - pluginVerifier() + // Use a specific version of the verifier + // TODO: remove when https://youtrack.jetbrains.com/issue/MP-7366 is fixed + pluginVerifier(version = "1.383") testFramework(TestFrameworkType.Plugin.Java) zipSigner() } @@ -248,7 +249,9 @@ intellijPlatform { } failureLevel.set( setOf( - COMPATIBILITY_PROBLEMS, + // Temporarily disabled due to https://platform.jetbrains.com/t/plugin-verifier-fails-with-plugin-com-intellij-modules-json-not-declared-as-a-plugin-dependency/580 + // TODO: Uncomment when https://youtrack.jetbrains.com/issue/MP-7366 is fixed + // COMPATIBILITY_PROBLEMS, INTERNAL_API_USAGES, INVALID_PLUGIN, PLUGIN_STRUCTURE_WARNINGS,