E326 Route KSP diagnostics through BTA while preserving console output by ganadist · Pull Request #3287 · google/ksp · GitHub
[go: up one dir, main page]

Skip to content

Route KSP diagnostics through BTA while preserving console output - #3287

Open
ganadist wants to merge 10 commits into
google:mainfrom
ganadist:support_bta
Open

ganadist wants to merge 10 commits into
google:mainfrom
ganadist:support_bta

Conversation

@ganadist
Copy link
Copy Markdown

Give KSP warnings and errors a Kotlin Build Tools API (BTA) diagnostic adapter while preserving their existing console output.
KSP2 runs independently of Kotlin compilation, so its diagnostics need a separate bridge to the build system.

  • The bridge requires compiler 2.4.0+ and uses standard Gradle properties and target defaults; KGP-specific local.properties and extra-property overrides do not control KSP diagnostics. JS, Wasm, and metadata use the opt-ins available from KGP 2.4.20; Native and unsupported configurations retain legacy logging. Setting ksp.diagnostics.useBuildToolsApi=false restores that path without changing Kotlin compilation.
  • The JDK DiagnosticListener carries the existing decorated message body, severity, and separate source metadata across the isolated engine boundary. BTA and Gradle classes stay outside the engine, which runs on the JVM for every Kotlin target.
  • Console prefixes, location text, log filtering, and processing failures retain their existing behavior. The bridge adapts KSP diagnostics to BTA's rendering contract; it does not run symbol processing as a BTA compilation.
  • A follow-up will use the same diagnostics with Gradle's Problems API. BTA and Problems support columns, but exposing them through KSP's public API requires further compatibility decisions. Current producers supply files and lines, and the diagnostic contract and adapters retain column support.

Related to #2504.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0