kosi-libs/MocKMP

Provide a way to apply MocKMP to commonMain as well

dalewking opened this issue · 5 comments

I have a testSupport module in my project that generates code to support testing for both common code and for the Android app tests. The project is included as a test dependency in other modules.

The code for the testSupport module is in commonMain, not in commonTest. I want to create Mocks in this code, but the gradle plugin only supports applying it to the commonTest sourceSet

You should provide a configuration value that allows you to switch to applying it to commonMain instead of commonTest

Supported in 1.12.0.

https://github.com/kosi-libs/MocKMP#applying-to-main-source-sets

Thanks for the suggestion ;)

Only problem is that you released that in 1.12.0 which requires Kotlin 1.8 which we have not upgraded to yet.

But was not difficult to force KSP version

Take that back, does not work for force Kotlin 1.7 version with 1.12.0

Thinking about it some more there are going to be cases where we may need to apply to platform specific source sets as well. Coupled with the ksp versioning issue I'm thinking the gradle plugin may be a bad idea and I will probably try to just do it in the gradle files, much like Mockative does