-
Notifications
You must be signed in to change notification settings - Fork 46
/
Makefile.toml
38 lines (30 loc) · 1.46 KB
/
Makefile.toml
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
38
[env]
ENV_DIR = {source="${CARGO_MAKE_PROFILE}", default_value = "debug", mapping = {release = "release"}}
CARGO_TARGET_DIR = {value = "target", condition = {env_not_set = ["CARGO_TARGET_DIR"]}}
TARGET_DIR = "target"
CARGO_WASM_EXAMPLE_PATH = "${CARGO_TARGET_DIR}/wasm32-unknown-unknown/${ENV_DIR}/examples/${CARGO_MAKE_TASK_ARGS}.wasm"
CARGO_PROFILE = "dev"
CARGO_MANIFEST_DIR = "${CARGO_MAKE_WORKING_DIRECTORY}"
ARG1 = "${@}"
[env.release]
CARGO_RELEASE_ARGS = "--release"
[tasks.install-wasm-target]
args = ["target", "install", "wasm32-unknown-unknown"]
command = "rustup"
[tasks.install-wasm-bindgen-cli]
install_crate = {crate_name = "wasm-bindgen-cli", binary = "wasm-bindgen", test_arg="--help"}
[tasks.install-basic-http-server]
install_crate = {crate_name = "basic-http-server", binary = "basic-http-server", test_arg="--help"}
[tasks.cargo-build-example]
args = ["build", "--target", "wasm32-unknown-unknown", "--example", "${CARGO_MAKE_TASK_ARGS}", "@@split(CARGO_RELEASE_ARGS, )"]
command = "cargo"
dependencies = ["install-wasm-target"]
[tasks.build-example]
args = ["--remove-name-section", "--remove-producers-section", "--out-dir", "${TARGET_DIR}", "--out-name", "wasm", "--target", "web", "--no-typescript", "${CARGO_WASM_EXAMPLE_PATH}"]
command = "wasm-bindgen"
dependencies = ["cargo-build-example", "install-wasm-bindgen-cli"]
[tasks.example]
command = "basic-http-server"
dependencies = ["build-example", "install-basic-http-server"]
[tasks.test]
disabled = true