[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"]}}
CARGO_WASM_PATH = "${CARGO_TARGET_DIR}/wasm32-unknown-unknown/${ENV_DIR}/${CARGO_MAKE_CRATE_NAME}.wasm"
CARGO_PROFILE = "dev"
TARGET_DIR = "target"
CARGO_MANIFEST_DIR = "${CARGO_MAKE_WORKING_DIRECTORY}"
[env.release]
CARGO_RELEASE_ARGS = "--release"
[tasks.show-env]
command = "env"
[tasks.install-target-wasm32-unknown-unknown]
args = ["target", "install", "wasm32-unknown-unknown"]
command = "rustup"
[tasks.basic-http-server]
install_crate = {crate_name = "basic-http-server", binary = "basic-http-server", test_arg="--help"}
[tasks.wasm-bindgen-cli]
install_crate = {crate_name = "wasm-bindgen-cli", version="0.2.69", binary = "wasm-bindgen", test_arg="--help"}
[tasks.cargo-build-web]
args = ["build", "--target", "wasm32-unknown-unknown", "--features", "web", "@@split(CARGO_RELEASE_ARGS, )"]
command = "cargo"
dependencies = ["install-target-wasm32-unknown-unknown"]
[tasks.build-web]
args = ["--out-dir", "${TARGET_DIR}", "--out-name", "wasm", "--target", "web", "--no-typescript", "${CARGO_WASM_PATH}"]
command = "wasm-bindgen"
dependencies = ["cargo-build-web", "wasm-bindgen-cli"]
[tasks.build-native]
args = ["build", "--features", "native", "@@split(CARGO_RELEASE_ARGS, )"]
command = "cargo"
[tasks.run]
command = "${CARGO_TARGET_DIR}/${ENV_DIR}/${CARGO_MAKE_BINARY_EXECUTABLE_NAME}"
dependencies = ["build-native"]
[tasks.serve]
command = "basic-http-server"
args = ["-x"]
dependencies = ["build-web", "basic-http-server"]
[tasks.test]
disabled = true