I followed the "<Create a custom compilation>" to ...
# multiplatform
j
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:
Copy code
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:
Copy code
dependencies {
    implementation(project(":shared"))
}
but that doesn't bring in the
spring
one but just the
main
one
r
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
thanks, I'll try defining a separate target
Thanks Russell once again for the pointers. I managed to solve it by using attributes 🦜
👍 1