When you create default project there is the follo...
# getting-started
e
When you create default project there is the following in
build.gradle
:
Copy code
jvmJar {
    dependsOn(jsBrowserWebpack)
    from(new File(jsBrowserWebpack.entry.name, jsBrowserWebpack.outputPath))
}
How do you express that in
build.gradle.kts
? Probably, I've got a part of this right, but I'm not sure about the last expression
Copy code
tasks.named("jvmJar") {
    dependsOn("jsBrowserWebpack")
}
d
Copy code
val jsBrowserWebpack by tasks.getting(JsBrowserWebpack::class) // not sure if this is the correct class name

tasks.named("jvmJar", Jar::class) {
    dependsOn(jsBrowserWebpack)
    from(File(jsBrowserWebpack.entry.name, jsBrowserWebpack.outputPath))
}
You need the correct task types
e
image.png
d
Read the comment in my code...
e
That is the part of the
build.gradle
from default project created via IntelliJ IDEA
d
Not sure what you are trying to say.
e
Just adding information
I cannot find JsBrowserWebpack in the source of Kotlin neither
d
Yes, like I said I don't know what the class name is. But you need to use the actual task class for that task
Looks like its
org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack
e
How did you find it?
d
Copy code
val jsBrowserWebpack by tasks.getting

project.afterEvaluate {
    println(jsBrowserWebpack::class)
}
e
oh, thank you!