kosi-libs / MocKMP

A mocking processor for Kotlin Multiplatform
https://kosi-libs.org/mockmp
MIT License
183 stars 12 forks source link

Duplicated source roots #76

Closed GoodSir42 closed 3 months ago

GoodSir42 commented 4 months ago

Hello! I am happily using your library for testing my KMP project but I have an issue getting it to work with Kotlin 2.0.0 (and the issue also happens on 1.9.23 for me).

All Mock and _injectMocks.kt files are generated for androidUnitTestDebug (which, if I understand it correctly is working as intended), but then they are linked to both the source set for androidUnitTestDebug and commonTest which is a warning in Kotlin 1.9.23 and unfortunately a crash in 2.0.0 (currently RC2).

There also seems to be an open issue at jetbrains which might or might not be linked: https://youtrack.jetbrains.com/issue/KT-65426

It would be great if you could help me track this issue down (and especially tell me whether the 1.9.23 warning is intended/common)

GoodSir42 commented 3 months ago

just for tracing: The issue persists with Kotlin 2.0.0-RC3

SalomonBrys commented 3 months ago

I've seen this. I will address it ASAP, bit probably not within the next two weeks.

GoodSir42 commented 3 months ago

Thanks a lot for the response :) If you can point me into a rough direction I can also have a look and make a pull request

jmrp-bsh commented 3 months ago

this is also happening with me, only after migrating to kotlin 2.0.0

SalomonBrys commented 3 months ago

I've opened #77 with a lot of information of why this is happening, and why I haven't found a solution yet. Make sure to read it, and provide insight if you can. I'm closing this in favor of #77.