Skip to content

Broken scan of annotated elements for KMP app modules since KSP2 (After 2.1.20-1.0.31) - Impact Koin Annotations framework #2695

@arnaudgiuliani

Description

@arnaudgiuliani

Hello,

I'm maintaining the Koin framework. The Koin Annotations project uses the KSP project for annotation processing.

We use Resolver.getDeclarationsFromPackage() to scan annotations from other modules. It works in KSP 2.3.1 & Android applications.
For KMP apps, it stops working since 2.1.20-1.0.31 & KSP1.

When switching to KSP2, other modules' annotations are not seen from the commonMain task. Seems to appear in the android detected element, where it should not (I'm scanning an element declared in commonMain generation).

This project uses KSP. The data module should allow to scan external module and associate them. The Data Module is not detected since KSP2 version.
example-cmp.zip

To look at it in the KSP2 issue, update the attached project with:

// libs.version.toml

koin-annotations = "2.3.0"
ksp = "2.3.1"

// gradle.properties
ksp.useKSP2=true

We are quite stuck on it:

Thanks, let me know how I can help solve it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AAwaiting for upstream fixP1major features or blocking bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions