Skip to content

feat(ksp): migrate the Kotlin processor from kapt to KSP #36

Description

@LMLiam

Problem

The processor is consumed via kapt, which JetBrains has placed in maintenance mode in favor of KSP/KSP2. kapt generates Java stubs for every Kotlin compilation (slow) and is not the recommended path going forward. Offering a KSP implementation would speed up Kotlin consumer builds and future‑proof the tool.

Evidence

  • README/CONTRIBUTING document kapt as the Kotlin integration (README.md:40,53, links to the kapt docs README.md:58).
  • The build applies org.jetbrains.kotlin.kapt (build.gradle:4, subprojects { apply plugin: 'org.jetbrains.kotlin.kapt' }).
  • The current processor is a javax.annotation.processing.Processor (ServiceSchemeProcessor.kt), which works under kapt/javac but cannot be used by KSP directly.

Proposed implementation

  • Add a KSP SymbolProcessor/SymbolProcessorProvider implementation (new module, e.g. modules/processor-ksp) that reuses the same contract/provider discovery and META-INF/services generation logic, sharing core code where practical.
  • Publish it as an additional artifact (e.g. spi-tooling-processor-ksp) and document ksp(...) wiring in the README alongside (or instead of) kapt.
  • Keep the javax processor for Java/annotationProcessor consumers.

Acceptance criteria

  • A Kotlin project can register the processor via ksp(...) and get identical META-INF/services output.
  • Tests cover the KSP path (e.g. via kotlin-compile-testing's KSP support).
  • README documents kapt vs KSP vs annotationProcessor.

✅ Triage decision (2026-06-06)

Migrate the Kotlin path off kapt entirely to KSP (kapt is in maintenance mode). KSP becomes the supported Kotlin integration; remove kapt from the build and docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:processorAnnotation processor: discovery, validation, META-INF/services generationbreaking-changeChange that may break existing setup or workflowsstatus:readyTriaged and ready for worktype:featureFeature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions