what would i need to do to a kotlin/js build.gradl...
# javascript
j
what would i need to do to a kotlin/js build.gradle.kts to also allow running on the jvm as a desktop app?
a
do you mean in node?
j
no, I mean in kotlin/jvm
a
it is kind of illogical trying to run a kotlin/js app woth kotlin/jvm. Don't you think?? Unless you are looking for a kotlin multiplatfrom approach, to run the same code on different environments
j
that is what I am looking for. in particular, the debugging experience on complex js projects is mostly broken, I'd like to debug on jvm first
a
That is very possible. Infact it is what I am doing. Write your tests on commonTest and with the gutter icon on IDEA on your test, you can choose to debug on jvm
j
Is there an example of how to do this somewhere? I tried
Copy code
plugins {
    kotlin("js") version "1.6.21"
    kotlin("jvm") version "1.6.21"
}
and got back
Copy code
> Failed to apply plugin 'org.jetbrains.kotlin.jvm'.
> Cannot add extension with name 'kotlin', as there is an extension already registered with that name.
r
j
@rnett that is where I started, but none of the scenarios there describe what I'm trying to do, and none of the examples seem relevant
a
For starters, apply the kotlin/multiplatform plugin, instead of applying the kotlin/js and kotlin/jvm plugin Secondly, make sure you have both, a jvm target and a js target Thirdly Put all your tests in commonTest Finally You can run those test in any environment
j
TY!