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

jean

07/27/2020, 2:15 PM
I’m trying to create a mpp project targeting the jvm for ktor and android. Where should I put the ktor gradle things like this ?
Copy code
group = "some.group.id"
version = "0.2.0"

application {
    mainClassName = "io.ktor.server.netty.EngineMain"
}

tasks.withType<ShadowJar> {
    archiveBaseName.set("some.group.id")
    archiveClassifier.set("")
    archiveVersion.set("")
}
Should I have a specific
build.gradle.kts
under
backendMain
(source set for my ktor backend) ?
r

russhwolf

07/27/2020, 10:43 PM
You can't apply the
application
plugin at the same time as the Android gradle plugin. So probably you'd want your shared code to just be a library module, and then your server code would live in a separate JVM-only module that can do the usual config.
👍 1
j

jean

07/28/2020, 7:13 AM
yes that’s what I’m trying to do. The thing I’m not sure about is how to organize the whole thing should it be some thing like that (sub project within the mpp project) :
Copy code
- mpp project
-- android
-- backend
Or should it be three distinct project? And in this case how do I use the shared code in the othe project? All the examples I can find from jetbrains use a sub project structure, so I guess that’s the way to go?
2 Views