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

Casey Brooks

07/08/2019, 4:25 PM
How can I make a pure Kotlin/JVM Gradle module depend on the
jvmMain
output from another multiplatform module? Normally I’d use
implementation(project(":lib"))
, but it doesn’t seem to be working when
:lib
is a multiplatform project
I’m using the Kotlin DSL by the way
r

russhwolf

07/08/2019, 4:51 PM
I think that should work. Make sure you have
enableFeaturePreview("GRADLE_METADATA")
in
settings.gradle.kts
c

Casey Brooks

07/09/2019, 6:43 PM
After playing around with this a bit more, it seems like that does indeed work for Gradle, but Intellij doesn’t seem to like it.
r

russhwolf

07/09/2019, 7:26 PM
There are lots of cases for more complex project structures where things look weird in Intellij but work fine from gradle. If you have a minimal example I recommend filing a bug at kotl.in/issue but unfortunately some of this is just to be expected since we’re still in the experimental/early-adopter phase with all of this.
But I’m pretty sure a vanilla project with a single multiplatform module and a single JVM consumer module works fine in IDEA right now. I’m guessing your actual project is probably more complicated than this.
8 Views