Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to apply MocKMP to commonMain as well #47

Closed
dalewking opened this issue Jan 27, 2023 · 5 comments
Closed

Provide a way to apply MocKMP to commonMain as well #47

dalewking opened this issue Jan 27, 2023 · 5 comments

Comments

@dalewking
Copy link

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

@SalomonBrys
Copy link
Member

Supported in 1.12.0.

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

Thanks for the suggestion ;)

@dalewking
Copy link
Author

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

@dalewking
Copy link
Author

But was not difficult to force KSP version

@dalewking
Copy link
Author

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

@dalewking
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants