Sam Estep
02/26/2024, 3:14 PM/opt/homebrew/bin/kotlin*
but these were the only ones i saw:
• kotlin
• kotlin-dce-js
• kotlinc
• kotlinc-js
• kotlinc-jvm
and when i run kotlinc-js -help
i don't see anything about wasm, so i'm guessing that isn't the right tool; anyways, is there a way i can do this?Svyatoslav Kuzmich [JB]
02/26/2024, 3:39 PMkotlinc-js
. I have found a script I made for a simple case. It runs CLI two times: compiling .klib
and .wasm
. Additionally you will need a stdlib library of the same version with path written to STDLIB variable.
SRC=$1
OUT_DIR=$2
MODULE_NAME=$3
STDLIB=/path/to/kotlin-stdlib-wasm-js.klib
kotlinc-js -Xwasm -libraries $STDLIB -ir-output-dir=$OUT_DIR/klib -ir-output-name $MODULE_NAME -Xir-produce-klib-file $SRC
kotlinc-js -Xwasm -libraries $STDLIB -ir-output-dir=$OUT_DIR/wasm -ir-output-name $MODULE_NAME -Xir-produce-js -Xinclude=$OUT_DIR/klib/$MODULE_NAME.klib
Svyatoslav Kuzmich [JB]
02/26/2024, 3:48 PMkotlinc-js -X
would show help for all -X…
flags that are missing from -help
If you have a gradle build, you can run it with --debug
and fish out the kotlinc-js
arguments from the debug log to replicate it manually.Sam Estep
02/26/2024, 4:38 PM