Trying to run the jvm part of my multiplatform cli...
# multiplatform
d
Trying to run the jvm part of my multiplatform cli (with and without gradle application plugin). From https://play.kotlinlang.org/hands-on/Introduction%20to%20Kotlin%20Multiplatform/03_multiplatform_jvm this used to work like:
Copy code
kotlin.code.style=official
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false

plugins {
    kotlin("multiplatform") version Deps.JetBrains.Kotlin.VERSION
    id("com.github.johnrengelman.shadow") version Deps.Plugins.Shadow.VERSION
    //application
}

val run by tasks.creating(JavaExec::class) {
    group = group
    main = theMainClass + "Kt"
    kotlin {
        val main = targets["jvm"].compilations["main"]
        dependsOn(main.compileAllTaskName)
        classpath(
            { main.output.allOutputs.files },
            { configurations["jvmRuntimeClasspath"] }
        )
    }
    systemProperty("java.awt.headless", "true") // disable app icon on macOS
}

same for

tasks.getByName<JavaExec>("run") {
    systemProperty("java.awt.headless", "true") // disable app icon on macOS
    classpath(tasks.getByName<Jar>("jvmJar")) // so that the JS artifacts generated by `jvmJar` can be found and served
    //classpath(project.getConfigurations().getByName("jvmRuntimeClasspath").files)
}
but now I get
KotlinTarget with name 'jvm' not found.
(respectively
Task with name 'jvmJar' not found in root project
) seems there only is one
'metadata'
target ... any ideas?