|
|
|
[env]
|
|
|
|
# all workspace members can use this Makefile
|
|
|
|
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"
|
|
|
|
PORT = "8000"
|
|
|
|
|
|
|
|
# ---- BUILD & CREATE WASMS ----
|
|
|
|
[tasks.build]
|
|
|
|
description = "Build"
|
|
|
|
workspace = false
|
|
|
|
command = "cargo"
|
|
|
|
args = ["build"]
|
|
|
|
|
|
|
|
[tasks.build_release]
|
|
|
|
description = "Build, with the --release flag"
|
|
|
|
workspace = false
|
|
|
|
command = "cargo"
|
|
|
|
args = ["build", "--release"]
|
|
|
|
|
|
|
|
|
|
|
|
[tasks.create_wasms]
|
|
|
|
description = "Build with wasm-pack"
|
|
|
|
workspace = false
|
|
|
|
command = "cargo"
|
|
|
|
args = ["make", "create_wasm"]
|
|
|
|
|
|
|
|
[tasks.all]
|
|
|
|
description = "Build, and create wasms"
|
|
|
|
workspace = false
|
|
|
|
dependencies = ["build", "create_wasms"]
|
|
|
|
|
|
|
|
[tasks.all_release]
|
|
|
|
description = "Build, and create wasms, with the --release flag"
|
|
|
|
workspace = false
|
|
|
|
dependencies = ["build_release", "create_wasms"]
|
|
|
|
|
|
|
|
[tasks.serve]
|
|
|
|
description = "Start server"
|
|
|
|
install_crate = { crate_name = "microserver", binary = "microserver", test_arg = "-h" }
|
|
|
|
workspace = false
|
|
|
|
command = "microserver"
|
|
|
|
args = ["--port", "${PORT}"]
|
|
|
|
|
|
|
|
# ---- PRIVATE TASKS - run only inside another task ----
|
|
|
|
# private atribute is ignored (bug?)
|
|
|
|
|
|
|
|
[tasks.create_wasm]
|
|
|
|
description = "Build example with wasm-pack"
|
|
|
|
# private = true
|
|
|
|
install_crate = "wasm-pack"
|
|
|
|
command = "wasm-pack"
|
|
|
|
args = ["build", "--target", "no-modules", "--out-name", "package"]
|