https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

jush

06/09/2021, 6:50 AM
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

russhwolf

06/09/2021, 12:40 PM
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

06/09/2021, 1:12 PM
thanks, I'll try defining a separate target
Thanks Russell once again for the pointers. I managed to solve it by using attributes 🦜
👍 1
4 Views