Skip to content

Commit 0c075c8

Browse files
authored
Bump Kotlin to 2.1.20 (#6431)
* Bump Kotlin to 2.1.20 * Remove redundant when cases, reported as warnings * 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. * Give more RAM to the plugin verifier * Re enable COMPATIBILITY_PROBLEMS in the plugin verifier * Try to give more memory to the plugin verifier * Try to give even more memory to the plugin verifier. Also lower the log level. * Try using Java 24 * Try using Java 23 * Revert Plugin Verifier to v1.383 due to https://youtrack.jetbrains.com/issue/MP-7366
1 parent 8823ac2 commit 0c075c8

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
125125
with:
126126
distribution: 'temurin'
127-
java-version: 17
127+
java-version: 23
128128

129129
# Set environment variables
130130
- name: Export Properties
@@ -166,7 +166,7 @@ jobs:
166166
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
167167
- name: Run Plugin Verification tasks
168168
env:
169-
JAVA_TOOL_OPTIONS: -Dlogback.configurationFile=${{ github.workspace }}/intellij-plugin/logback.xml
169+
JAVA_TOOL_OPTIONS: -Xmx4g -Dlogback.configurationFile=${{ github.workspace }}/intellij-plugin/logback.xml
170170
run: ./gradlew :intellij-plugin:verifyPlugin -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
171171

172172
# Collect Plugin Verifier Result

gradle/libraries.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ javaPoet = "1.13.0"
2727
jetbrains-annotations = "24.0.1"
2828
junit = "4.13.2"
2929
kotlin-plugin-min = "1.9.0"
30-
kotlin-plugin = "2.1.10"
31-
kotlin-plugin-max = "2.1.10"
30+
kotlin-plugin = "2.1.20"
31+
kotlin-plugin-max = "2.1.20"
3232
kotlinx-coroutines = "1.9.0"
3333
kotlinx-datetime = "0.5.0"
3434
kotlinx-serialization-runtime = "1.6.2"
35-
ksp = "2.1.10-1.0.29"
35+
ksp = "2.1.20-1.0.31"
3636
ktor = "3.0.0"
3737
moshix = "0.14.1"
3838
node-fetch = "2.7.0"

intellij-plugin/build.gradle.kts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
21
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
32
import org.gradle.api.tasks.testing.logging.TestLogEvent
43
import org.jetbrains.changelog.markdownToHTML
54
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
5+
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.COMPATIBILITY_PROBLEMS
66
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INTERNAL_API_USAGES
77
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INVALID_PLUGIN
88
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.PLUGIN_STRUCTURE_WARNINGS
9+
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
910
import java.net.URI
1011
import java.text.SimpleDateFormat
1112
import java.util.Date
@@ -55,6 +56,9 @@ kotlin {
5556
}
5657

5758
val apolloDependencies = configurations.create("apolloDependencies").apply {
59+
attributes {
60+
attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm)
61+
}
5862
listOf(":apollo-annotations", ":apollo-api", ":apollo-runtime").forEach {
5963
dependencies.add(project.dependencies.project(it, "jvmApiElements"))
6064
}
@@ -160,7 +164,9 @@ dependencies {
160164
bundledPlugins(properties("platformBundledPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
161165
plugins(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
162166
instrumentationTools()
163-
pluginVerifier()
167+
// Use a specific version of the verifier
168+
// TODO: remove when https://youtrack.jetbrains.com/issue/MP-7366 is fixed
169+
pluginVerifier(version = "1.383")
164170
testFramework(TestFrameworkType.Plugin.Java)
165171
zipSigner()
166172
}
@@ -243,8 +249,9 @@ intellijPlatform {
243249
}
244250
failureLevel.set(
245251
setOf(
246-
// 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
247-
// COMPATIBILITY_PROBLEMS,
252+
// 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
253+
// TODO: Uncomment when https://youtrack.jetbrains.com/issue/MP-7366 is fixed
254+
// COMPATIBILITY_PROBLEMS,
248255
INTERNAL_API_USAGES,
249256
INVALID_PLUGIN,
250257
PLUGIN_STRUCTURE_WARNINGS,

intellij-plugin/logback.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</encoder>
77
</appender>
88

9-
<root level="DEBUG">
9+
<root level="INFO">
1010
<appender-ref ref="STDOUT" />
1111
</root>
1212

libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/RegisterOperations.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ private fun GQLSelection.score(): String {
5151
is GQLField -> "a$name"
5252
is GQLFragmentSpread -> "b$name"
5353
is GQLInlineFragment -> "c" // apollo-tooling doesn't sort inline fragments
54-
else -> error("Cannot sort Selection '$this'")
5554
}
5655
}
5756

libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling/serialization.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ internal fun JsonElement.toAny(): Any? = when (this) {
2121
else -> booleanOrNull ?: intOrNull ?: longOrNull ?: doubleOrNull ?: error("cannot decode $this")
2222
}
2323
}
24-
else -> error("cannot convert $this to Any")
2524
}
2625

2726
fun Any?.toJsonElement(): JsonElement = when (this) {
@@ -32,4 +31,4 @@ fun Any?.toJsonElement(): JsonElement = when (this) {
3231
is String -> JsonPrimitive(this)
3332
null -> JsonNull
3433
else -> error("cannot convert $this to JsonElement")
35-
}
34+
}

0 commit comments

Comments
 (0)