Could you remind me how to add JavaExec task to mu...
# multiplatform
a
Could you remind me how to add JavaExec task to mutliplatform? I believe it was answered several times, but I forgot again.
d
With
1.3.40
you can now use the application gradle plugin.
a
Oh? I think I've missed that. I will try it, thanks
d
No problem.
a
I've already solved the problem with
Copy code
tasks.register<JavaExec>("runSwing") {
    group = "run"
    val target = kotlin.targets["jvm"]
    val compilation: KotlinCompilationToRunnableFiles<KotlinCommonOptions> =
        target.compilations["main"] as KotlinCompilationToRunnableFiles<KotlinCommonOptions>

    val classes = files(
        compilation.runtimeDependencyFiles,
        compilation.output.allOutputs
    )
    classpath = classes


    main = "ru.mipt.phys.diffraction.AppFrameKt"
}
but application is better.
Does not seem to work with application plugin with default configuration. Are there any examples?
Solved it myself. I just needed to add
withJava()
to jvm configuration