Update Kotlin to 2.3.10 (#1453)
diff --git a/docs/kotlin.md b/docs/kotlin.md index f303c4f..42e1a2d 100644 --- a/docs/kotlin.md +++ b/docs/kotlin.md
@@ -601,8 +601,8 @@ | <a id="kotlin_repositories-is_bzlmod"></a>is_bzlmod | <p align="center"> - </p> | `False` | | <a id="kotlin_repositories-compiler_repository_name"></a>compiler_repository_name | for the kotlinc compiler repository. | `"com_github_jetbrains_kotlin"` | | <a id="kotlin_repositories-ksp_repository_name"></a>ksp_repository_name | <p align="center"> - </p> | `"com_github_google_ksp"` | -| <a id="kotlin_repositories-compiler_release"></a>compiler_release | version provider from versions.bzl. | `struct(sha256 = "ea16ab1cab29d419bf41b60ecc0e305d449fa661d9c05fbcc5b2a6672505456a", url_templates = ["https://github.com/JetBrains/kotlin/releases/download/v{version}/kotlin-compiler-{version}.zip"], version = "2.3.0")` | -| <a id="kotlin_repositories-ksp_compiler_release"></a>ksp_compiler_release | (internal) version provider from versions.bzl. | `struct(sha256 = "24cb0d869ab2ae9fcf630a747b6b7e662e4be26e8b83b9272f6f3c24813e0c5a", url_templates = ["https://github.com/google/ksp/releases/download/{version}/artifacts.zip"], version = "2.3.3")` | +| <a id="kotlin_repositories-compiler_release"></a>compiler_release | version provider from versions.bzl. | `struct(sha256 = "c8d546f9ff433b529fb0ad43feceb39831040cae2ca8d17e7df46364368c9a9e", url_templates = ["https://github.com/JetBrains/kotlin/releases/download/v{version}/kotlin-compiler-{version}.zip"], version = "2.3.10")` | +| <a id="kotlin_repositories-ksp_compiler_release"></a>ksp_compiler_release | (internal) version provider from versions.bzl. | `struct(sha256 = "91e7f24924fdf6328d3b85fe854e863a18b97de6a4ad09dd5326a591b7a1b010", url_templates = ["https://github.com/google/ksp/releases/download/{version}/artifacts.zip"], version = "2.3.5")` | <a id="versions.use_repository"></a>
diff --git a/kotlin/compiler/ksp.bzl b/kotlin/compiler/ksp.bzl index 697aece..9bb8261 100644 --- a/kotlin/compiler/ksp.bzl +++ b/kotlin/compiler/ksp.bzl
@@ -43,3 +43,9 @@ name = "symbol-processing-api", jar = _KSP_COMPILER_PLUGIN_REPO_PREFIX + "symbol-processing-api.jar", ) + + # KSP 2.3.5+ analysis API implementation expects the IntelliJ coroutines variant. + kt_jvm_import( + name = "ksp-intellij-kotlinx-coroutines-core-jvm", + jar = _KSP_COMPILER_PLUGIN_REPO_PREFIX + "kotlinx-coroutines-core-jvm-intellij.jar", + )
diff --git a/kotlin/internal/jvm/jvm.bzl b/kotlin/internal/jvm/jvm.bzl index 876ccb8..0125008 100644 --- a/kotlin/internal/jvm/jvm.bzl +++ b/kotlin/internal/jvm/jvm.bzl
@@ -141,7 +141,7 @@ ), "_ksp2_kotlinx_coroutines": attr.label( doc = "kotlinx-coroutines-core-jvm JAR required by KSP2", - default = Label("//kotlin/compiler:kotlinx-coroutines-core-jvm"), + default = Label("//kotlin/compiler:ksp-intellij-kotlinx-coroutines-core-jvm"), cfg = "exec", ), "_ksp2_symbol_processing_aa": attr.label(
diff --git a/src/main/starlark/core/repositories/ksp.bzl b/src/main/starlark/core/repositories/ksp.bzl index b2791ad..045c173 100644 --- a/src/main/starlark/core/repositories/ksp.bzl +++ b/src/main/starlark/core/repositories/ksp.bzl
@@ -4,6 +4,12 @@ "symbol-processing-api", ] +_KOTLINX_COROUTINES_INTELLIJ = struct( + version = "1.8.0-intellij-14", + sha256 = "ef043856ef8f38703916960fac169c359d98d5febd571d67fccdfe75ba378de3", + url_template = "https://repo1.maven.org/maven2/org/jetbrains/intellij/deps/kotlinx/kotlinx-coroutines-core-jvm/{version}/kotlinx-coroutines-core-jvm-{version}.jar", +) + def _ksp_compiler_plugin_repository_impl(repository_ctx): """Creates the KSP repository.""" attr = repository_ctx.attr @@ -20,6 +26,13 @@ }, ) + # KSP 2.3.5+ has a runtime dependency on the IntelliJ coroutines variant. + repository_ctx.download( + url = _KOTLINX_COROUTINES_INTELLIJ.url_template.format(version = _KOTLINX_COROUTINES_INTELLIJ.version), + sha256 = _KOTLINX_COROUTINES_INTELLIJ.sha256, + output = "kotlinx-coroutines-core-jvm-intellij.jar", + ) + # Remove unused .pom and checksum files files. repository_ctx.delete("com")
diff --git a/src/main/starlark/core/repositories/versions.bzl b/src/main/starlark/core/repositories/versions.bzl index 737d52b..b4e2756 100644 --- a/src/main/starlark/core/repositories/versions.bzl +++ b/src/main/starlark/core/repositories/versions.bzl
@@ -82,25 +82,25 @@ sha256 = "5ba1ac917a06b0f02daaa60d10abbedd2220d60216af670c67a45b91c74cf8bb", ), KOTLIN_CURRENT_COMPILER_RELEASE = version( - version = "2.3.0", + version = "2.3.10", url_templates = [ "https://github.com/JetBrains/kotlin/releases/download/v{version}/kotlin-compiler-{version}.zip", ], - sha256 = "ea16ab1cab29d419bf41b60ecc0e305d449fa661d9c05fbcc5b2a6672505456a", + sha256 = "c8d546f9ff433b529fb0ad43feceb39831040cae2ca8d17e7df46364368c9a9e", ), KSP_CURRENT_COMPILER_PLUGIN_RELEASE = version( - version = "2.3.3", + version = "2.3.5", url_templates = [ "https://github.com/google/ksp/releases/download/{version}/artifacts.zip", ], - sha256 = "24cb0d869ab2ae9fcf630a747b6b7e662e4be26e8b83b9272f6f3c24813e0c5a", + sha256 = "91e7f24924fdf6328d3b85fe854e863a18b97de6a4ad09dd5326a591b7a1b010", ), KOTLIN_BUILD_TOOLS_IMPL = version( - version = "2.3.0", + version = "2.3.10", url_templates = [ "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-build-tools-impl/{version}/kotlin-build-tools-impl-{version}.jar", ], - sha256 = "93a5e8ffb1000801c832a862b23bd9766f444e6f6c185c32b1fb57877fb5cea3", + sha256 = "32f02a6af72b8e0c82f26343b68e0d1da1c844827478feb2fa9dc40df5f9bb5a", ), RULES_ANDROID = version( version = "0.7.0",