Skip to content

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

@hfhbd

Description

@hfhbd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GradleIssues with KSP Gradle Plugin, AGP or Gradle.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions