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

christophsturm

11/03/2020, 3:00 PM
can i split a multiplatform project into multiple gradle subprojects, and have the jvm main be just a normal kotlin project that consumes the jvm build of the common module?
a

aleksey.tomin

11/03/2020, 3:07 PM
Yes, you can. JVM is a regular part of KMP.
c

christophsturm

11/03/2020, 3:16 PM
is there an example somewhere?
j

Javier

11/03/2020, 3:30 PM
It is exactly the same if a jvm module uses another jvm module, the only difference is applying the multiplatform module and the gradle setup for it, but later the main module just have to do
implementation(project(:my-multiplatform-module))
Copy code
// main-module
plugins {
    kotlin("jvm")
}

dependencies {
    implementation(project(":second-module"))
}

// second-module
plugins {
    kotlin("multiplatform")
}

kotlin {
   jvm()

   // rest of code
}
c

christophsturm

11/03/2020, 6:58 PM
thanks!
7 Views