Skip to content

Commit

Permalink
feat: Add wasm-gc bundle target for moonbit core lib (#20)
Browse files Browse the repository at this point in the history
* feat: Add wasm-gc bundle target for moonbit core lib

* feat: Add wasm-gc bundle target for moonbit core lib
  • Loading branch information
hustcer authored Nov 8, 2024
1 parent 6a7f9bc commit 1371a71
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions nu/moonbit.nu
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# Author: hustcer
# Created: 2023/11/02 20:33:15
# TODO:
# [x] Install all moon* binaries
# [x] Support Windows, macOS, Linux
# [x] This script should run both in Github Runners and local machines
# [x] Setup moonbit toolchains of specified version
# [x] Setup Moonbit Core support
# [?] Setup monnbit core of `bleeding` version support
# [] Install all moon* binaries
# [] Support Windows, macOS, Linux
# [] This script should run both in Github Runners and local machines
# [] Setup moonbit toolchains of specified version
# [] Setup Moonbit Core support
# [] Setup monnbit core of `bleeding` version support
# Description: Scripts for setting up MoonBit environment
# Usage:
# setup moonbit
Expand Down Expand Up @@ -74,7 +74,11 @@ export def 'setup moonbit' [
} else {
fetch-release $version $'moonbit-($archive).tar.gz'
tar xf $'moonbit-($archive).tar.gz' --directory $MOONBIT_BIN_DIR
ls $MOONBIT_BIN_DIR | get name | each { chmod u+x $in }
const IGNORE = [libtcc1.a]
ls $MOONBIT_BIN_DIR
| get name
| filter { ($in | path basename) not-in $IGNORE }
| each { chmod +x $in }
rm moonbit*.tar.gz
}

Expand Down Expand Up @@ -104,9 +108,11 @@ export def 'setup moonbit' [
if (windows?) {
unzip core*.zip -d $MOONBIT_LIB_DIR; rm core*.zip
moon.exe bundle --all --source-dir $'($MOONBIT_LIB_DIR)/core'
moon.exe bundle --target wasm-gc --source-dir $'($MOONBIT_LIB_DIR)/core' --quiet
} else {
tar xf core*.tar.gz --directory $MOONBIT_LIB_DIR; rm core*.tar.gz
moon bundle --all --source-dir $'($MOONBIT_LIB_DIR)/core'
moon bundle --target wasm-gc --source-dir $'($MOONBIT_LIB_DIR)/core' --quiet
}
}
}
Expand Down

0 comments on commit 1371a71

Please sign in to comment.