koin-annotations icon indicating copy to clipboard operation
koin-annotations copied to clipboard

@ComponentScan not properly generating expect / actual classes (2.0.0)

Open griffinsorrentino opened this issue 8 months ago • 0 comments
trafficstars

Describe the bug Using expect / actual classes as defined in https://insert-koin.io/docs/reference/koin-annotations/kmp does not generate the classes.

There are 2 scenarios where this is causing issues:

  1. Having expect / actual classes in a module generates the module in only the platform specific folder and not commonMain
  2. Adding a second library that also uses KSP prevents generation of expect / actual classes altogether

Both of the above scenarios are working as of 1.3.1

To Reproduce Reproducer project available @ https://github.com/griffinsorrentino/koin-issue

Steps to reproduce the working config:

  1. Go to the working-1.3.1 branch
  2. Sync gradle
  3. Clean the project
  4. Run the project

Steps to reproduce scenario 1 issue:

  1. Go to the broken-without-dep-2.0.0 branch
  2. Sync gradle
  3. Clean the project
  4. Run the project
  5. Open the build folder and observe that the generated file for commonMain is missing. You can no longer use the PlatformHelper module within commonMain

Steps to reproduce scenario 2 issue:

  1. Go to the broken-2.0.0 branch
  2. Sync gradle
  3. Clean the project
  4. Run the project
  5. Open the build folder and observe that while the commonMain file was generated, the module is empty.

Expected behavior Classes should be generated properly, as they were in 1.3.1

Koin project used and used version (please complete the following information): koin-core version 4.0.2 koin-annotations version 2.0.0

griffinsorrentino avatar Feb 25 '25 21:02 griffinsorrentino