n

    Nikola Milovic

    1 year ago
    sourceSets {
            named("commonMain") {
                dependencies {
                    implementation(project(":common:utils"))
                    implementation(project(":common:database"))
                    implementation(project(":common:main"))
                    implementation(project(":common:edit"))
                    implementation(Deps.ArkIvanov.MVIKotlin.mvikotlin)
                    implementation(Deps.ArkIvanov.Decompose.decompose)
                    implementation(Deps.Badoo.Reaktive.reaktive)
                }
            }
        }
    
        sourceSets {
            named("iosMain") {
                dependencies {
                    api(project(":common:database"))
                    api(project(":common:main"))
                    api(project(":common:edit"))
                }
            }
    From the Compose Todo sample app. Can someone explain to me why are we implementing the projects in the commonMain and then api them in the iosMain? Doesnt iosMain inherit from the commonMain? What do we achieve/ what's happening here?
    rnett

    rnett

    1 year ago
    api
    and
    implementation
    both add the dependency,
    api
    just exposes it to other libs that depend on this one. I'm not sure why those dependencies are there at all, tbh, I would think they would be included from common. If there's another module that depends on
    iosMain
    it may just to be to expose the dependencies.
    n

    Nikola Milovic

    1 year ago
    @rnett Thank you. It was confusing me, but this makes sense
    Jan M

    Jan M

    1 year ago
    @Nikola Milovic can you share the link to this project? I am struggling with my multi-module setup and this looks like a good reference. 🙂 thanks
    n

    Nikola Milovic

    1 year ago
    @Jan M Jetbrains compose sample, the Todo app. Its utilizing MVIKotlin and Decompose. Great resource