What does the IDE say the type is in that closure?
Vampire
10/11/2023, 2:27 PM
Seems to be
KotlinJvmRunDsl
which only allows to configure main class, arguments and classpath, so probably not from there. But you can probably directly configure the carrier task like
Copy code
val jvmRun by tasks.existing(JavaExec::class) {
workingDir = ...
}
e
edwinRNDR
10/11/2023, 2:33 PM
That gives me
Task with name 'jvmRun' not found in project
edwinRNDR
10/11/2023, 2:36 PM
I placed it in an
afterEvaluate {}
inside
jvm().mainRun{ }
and that seems to do the job
v
Vampire
10/11/2023, 2:41 PM
afterEvaluate
is evil, don't use it if avoidable. It's main effect is introducing timing problems, ordering problems, and race conditions, while usually just doing symptom treatment.