Thread
#multiplatform
    j

    jush

    1 year ago
    I followed the "Create a custom compilation" to add a new
    jvm
    custom compilation. It's not clear to me how can I add that new custom compilation as dependency in another module. More details in 🧵
    my
    shared
    module I define the new compilation:
    jvm() {
            compilations {
                val main by getting
                val spring by compilations.creating
            }
        }
    then in my other module (called
    jvmApp
    ) I don't know how to add the
    spring
    custom compilation as dependency. Currently I have:
    dependencies {
        implementation(project(":shared"))
    }
    but that doesn't bring in the
    spring
    one but just the
    main
    one
    russhwolf

    russhwolf

    1 year ago
    If the consumer also defined a
    spring
    compilation, does that pick it up correctly? You might instead want to try defining a separate target instead of a separate compilation, and then use attributes to disambiguate them: https://kotlinlang.org/docs/mpp-set-up-targets.html#distinguish-several-targets-for-one-platform
    j

    jush

    1 year ago
    thanks, I'll try defining a separate target
    Thanks Russell once again for the pointers. I managed to solve it by using attributes 😛arty-parrot: