Skip to content

Fix kotlin master builds #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged

Fix kotlin master builds #345

merged 1 commit into from
Jun 2, 2025

Conversation

Mr3zee
Copy link
Collaborator

@Mr3zee Mr3zee commented May 30, 2025

Subsystem
Compiler plugin, Gradle

Problem Description
Kotlin 2.2.0 brings yet another changes

Solution

  • Adapt to new diagnostics API
  • Added v_2_2_2 source set to distinguish between 2.2.0 and 2.2.20 versions.

@Mr3zee Mr3zee self-assigned this May 30, 2025
@Mr3zee Mr3zee added the housekeeping Some miscellaneous code base changes, tests, etc. label May 30, 2025
@Mr3zee Mr3zee requested a review from e5l May 30, 2025 15:20
@e5l e5l requested a review from Copilot June 2, 2025 07:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adapts the codebase to Kotlin 2.2.0 changes by updating the diagnostics API and introducing a new v_2_2_2 source set to distinguish between different Kotlin versions.

  • Updated several diagnostic checker classes and APIs under the new v_2_2_2 source set.
  • Refactored the registration of diagnostic renderer factories to use an overridden getRendererFactoryVs() method instead of static init blocks.
  • Harmonized version-specific API implementations and adjusted import statements.

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt Introduces updated checker classes using new context receiver syntax.
compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt Implements version‑specific APIs using updated extension properties.
compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirRpcSupertypeGenerator.kt Adapts the supertype generator logic for additional supertypes.
Various diagnostics files under v_2_2, pre_2_0_21, pre_2_0_10, and latest Update diagnostic container classes, renderer factory registration, and diagnostic factories.
compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/… Refactors diagnostic API registration to override getRendererFactoryVs().
compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirVersionSpecificApi.kt Cleans up unused imports to align with new Kotlin version changes.

@@ -35,13 +35,13 @@ object FirRpcDiagnostics {
val TYPE_PARAMETERS_IN_RPC_FUNCTION by error0<KtElement>(SourceElementPositioningStrategies.TYPE_PARAMETERS_LIST)
val TYPE_PARAMETERS_IN_RPC_INTERFACE by error0<KtElement>(SourceElementPositioningStrategies.TYPE_PARAMETERS_LIST)

init {
RootDiagnosticRendererFactory.registerFactory(RpcDiagnosticRendererFactory)
override fun getRendererFactoryVs(): BaseDiagnosticRendererFactory {
Copy link
Preview

Copilot AI Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a comment to explain the transition from using an init block for factory registration to the overridden getRendererFactoryVs() approach to aid future maintainers.

Copilot uses AI. Check for mistakes.

@@ -0,0 +1,60 @@
/*
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
Copy link
Preview

Copilot AI Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider standardizing the copyright year across files (e.g., updating to 2023-2025) for consistency.

Copilot uses AI. Check for mistakes.

@Mr3zee Mr3zee merged commit 700fad1 into main Jun 2, 2025
3 checks passed
@Mr3zee Mr3zee deleted the kotlin-master branch June 2, 2025 07:52
Mr3zee added a commit that referenced this pull request Jun 11, 2025
(cherry picked from commit 700fad1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Some miscellaneous code base changes, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants