google / google/ksp

KSP2: Compatibility with other code generators wired to generatedKotlin (KGP 2.3+)

Open
#2,735 0 comments 2 reactions 0 assignees View on GitHub
Gradle P4
Dominant language
Kotlin
Stars
3.5k
Forks
415
Avg merge
1d 2h
Merged PRs (30d)
53

Description

I have a Kotlin code generator producing Kotlin source code stored in a directory wired to the `kotlin.sourceSets.main.generatedKotlin.srcDir(myTask)`.

I have a (manually written) class in the `main` sourceSet that refers to a generated class located in the `generatedKotlin` srcDir, but ksp2 can't resolve this class.
When I change my code generator to use the old `kotlin` SourceDirectorySet via `kotlin.sourceSets.main.kotlin.srcDir(myTask)`, ksp2 works as expected.

How does ksp2 interact with the new generatedKotlin SourceDirectorySet? Or does KGP do not pass the `generatedKotlin` sources to ksp2?

KSP: 2.3.4
Kotlin: 2.3.0
Platform: JVM

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.