What is the difference between `produceExecutable(...
# javascript
r
What is the difference between
produceExecutable()
and
produceKotlinLibrary()
in Kotlin 1.4-M1 Gradle DSL?
s
from https://blog.jetbrains.com/kotlin/2020/03/kotlin-1-4-m1-released/ – but let me know if things are unclear about this description 🙂
produceKotlinLibrary()
just makes the absence of
produceExecutable()
explicit, but it’s the default behavior.
r
If I use the default (no executable js) will I be able to run any tests e.g. with Karma?
s
No, you need to generate “real” JavaScript code in order to execute it.
r
So no more tests for Kotlin Libs 😛
g
Is there any mode which produces Kotlin Lib, but also enables platform-specific testing? I think it’s how it eventually should work for MPP libs, you always produce Kotlin Lib as final artifact, but run test to all target platfroms
s
@Robert Jaros – sorry for digging up this old thread. But the behavior you mentioned is actually how
binaries.executable()
behaves. You will still be able to run your Karma tests. The test task will generate actual executable JS code. Makes a lot more sense that way, you were right. Looks like I took some of our internal documents too literally 😉