How should I correctly replace ```application { ...
# multiplatform
e
How should I correctly replace
Copy code
application {
    mainClass.set("com.example.ApplicationKt")
}
for jvm target when I use multiplatform setup? I get this error:
Error running 'ApplicationKt': Class 'com.example.ApplicationKt' not found in module 'com.example.main'
b
application plugin does not work with mpp plugin. You need to write your own javaexec task (see how it's done in kamp)
h
Simple use the multiplatform template from the wizard 🤔
Copy code
plugins {
    kotlin("multiplatform") version "1.6.10"
    application
}

repositories {
    mavenCentral()
}

kotlin {
    jvm {
        withJava()
    }
}

application {
    mainClass.set("example.application.ServerKt")
}

tasks.named<JavaExec>("run") {
    dependsOn(tasks.named<Jar>("jvmJar"))
    classpath(tasks.named<Jar>("jvmJar"))
}
b
Nice one. Didn't realize you could massage application plugin so easily to get it to work with mpp
👍 1