https://kotlinlang.org logo
g

Gunslingor

03/19/2020, 2:40 PM
I could really use some help, I don't understand why main runtime dependency is returning a config while the test runtime dependancy is, correctly, producing a file collection..... oddly enough this task doesnt run unless the classpath is set to the test one which makes no sense!
k

Kris Wong

03/19/2020, 3:05 PM
I would suggest using code navigation to explore the plugin source
g

Gunslingor

03/19/2020, 3:11 PM
Is there a way to do that in intelliJ since the plugin is just a string ?
Copy code
kotlin("multiplatform") version "1.3.70"
k

Kris Wong

03/19/2020, 3:40 PM
Cmd (Cntrl) + left click
g

Gunslingor

03/19/2020, 3:48 PM
yeah, doesnt usually work on libraries defined by strings and thats what gradle uses
I was able to go into it a bit using functions later down and learned a little, but its pretty tough to interpret
k

Kris Wong

03/19/2020, 3:50 PM
you can literally click on the property you're asking about,
runtimeDependencyFiles
g

Gunslingor

03/19/2020, 3:52 PM
yes I know, sorry... it just doesn't tell me anything. This really makes no sense why test would work but main wouldn't... almost like they are backwords
I could zip it up and send it to you its tiny, just the beginnings of new project, trying to setup structure
Sorry man, just been working on this rediculousness for like 19 hours my brain hurts
Does this mean anything to you, when it should be working I'm getting this Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
k

Kris Wong

03/19/2020, 4:21 PM
not to me
g

Gunslingor

03/19/2020, 4:49 PM
I figured it out I guess, just by jiggling it I guess. I had tried this before but was getting error on main = ""... I changed it to setMain and it magically worked. Still though I feel like there is another way to create a task outside of the jvm() object based on the docs, but I don't really get it... that was painful, thanks for the emotional support 😃
Copy code
jvm("backend") {
    compilations {
        val main by getting

        val runApplication by compilations.creating {
            tasks.register<JavaExec>("runApplication") {
                group = "fl"
                setMain("com.company.ApplicationKt")
                classpath = main.compileDependencyFiles + main.output.classesDirs + output.allOutputs
            }
        }
    }
}