-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
37 lines (29 loc) · 1.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
precommit: fmt clippy test
precommit-js:
@yarn install
@yarn build
@yarn format
@yarn lint
fmt:
@__GEAR_WASM_BUILDER_NO_FEATURES_TRACKING=1 cargo fmt --all -- --check
test:
@__GEAR_WASM_BUILDER_NO_FEATURES_TRACKING=1 cargo test --workspace --all-targets
clippy:
@__GEAR_WASM_BUILDER_NO_FEATURES_TRACKING=1 cargo clippy --workspace --all-targets -- -D warnings
build-parser:
@echo "Building idlparser"
@cargo build -p sails-idl-parser --target=wasm32-unknown-unknown --release
@ls -lah ./target/wasm32-unknown-unknown/release/sails_idl_parser.wasm
@cp ./target/wasm32-unknown-unknown/release/sails_idl_parser.wasm js/parser/parser.wasm
build-proxy:
# Just a regular build using the `wasm32-unknown-unknown` target.
@__GEAR_WASM_BUILDER_NO_FEATURES_TRACKING=1 cargo build -p proxy --target=wasm32-unknown-unknown
# Optinal optimization using `binaryen` tools.
@wasm-opt target/wasm32-unknown-unknown/debug/proxy.wasm -O4 -o target/wasm32-unknown-unknown/debug/proxy.opt.wasm -mvp --enable-sign-ext --zero-filled-memory --dae --vacuum -g
build-proxy-idl:
# This command has to be run every time there are changes in your contract.
# Essentially, it has to be a part of your build pipeline.
@__GEAR_WASM_BUILDER_NO_FEATURES_TRACKING=1 cargo run -p proxy -F="idl-gen" --bin proxy-idl-gen
build-js:
@echo "Building sails-js"
yarn build