You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.1 KiB
TOML
77 lines
2.1 KiB
TOML
[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}"]
|
|
|
|
# ---- TEST ----
|
|
|
|
[tasks.test]
|
|
description = "Run tests. Ex: 'cargo make test firefox'. Test envs: [chrome, firefox, safari]"
|
|
clear = true
|
|
workspace = false
|
|
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
|
|
command = "wasm-pack"
|
|
args = ["test", "--${@}"]
|
|
|
|
[tasks.test_release]
|
|
extend = "test"
|
|
description = "Run tests in release mode. Ex: 'cargo make test firefox'. Test envs: [chrome, firefox, safari]"
|
|
args = ["test", "--${@}", "--release"]
|
|
|
|
[tasks.test_h]
|
|
description = "Run headless tests. Ex: 'cargo make test_h firefox'. Test envs: [chrome, firefox, safari]"
|
|
extend = "test"
|
|
args = ["test", "--headless", "--${@}"]
|
|
|
|
[tasks.test_h_release]
|
|
extend = "test_h"
|
|
description = "Run headless tests in release mode. Ex: 'cargo make test_h firefox'. Test envs: [chrome, firefox, safari]"
|
|
args = ["test", "--headless", "--${@}", "--release"]
|
|
|
|
|
|
# ---- 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"]
|