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

MocKMP does not work with new androidSourceSetLayout #53

Closed
HylkeB opened this issue Mar 2, 2023 · 2 comments
Closed

MocKMP does not work with new androidSourceSetLayout #53

HylkeB opened this issue Mar 2, 2023 · 2 comments

Comments

@HylkeB
Copy link

HylkeB commented Mar 2, 2023

When using the latest version of MocKMP (version 1.12.0) combined with kotlin version 1.8.0, I got the following warning:

w: Multiplatform/Android-V1-SourceSetLayout: Multiplatform/Android-V1-SourceSetLayout is deprecated. Use Multiplatform/Android-V2-SourceSetLayout instead. 
To enable Multiplatform/Android-V2-SourceSetLayout: put the following in your gradle.properties: 
kotlin.mpp.androidSourceSetLayoutVersion=2

After changing that, and replacing androidTest for androidUnitTest in my gradle and folder names, MocKMP no longer properly generates the mocks. (probably in the wrong v1 sourceset location or something like that).

@dan-nichols
Copy link

Not sure if you've solved this already, but I think I had the same issue and have found a workaround for it.

kotlin {
    // ...
    sourceSets {
        // ...
        val commonTest by getting {
            dependencies {
                // ...
            }
            kotlin.srcDir("${project.buildDir}/generated/ksp/android/androidUnitTestDebug/kotlin")
        }
    }
}

It is very similar to the workaround described here, and mimics what the plugin does, just with the new source layout.

Hope this helps!

@SalomonBrys
Copy link
Member

Fix released in v1.14.0.

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

3 participants