|
@@ -0,0 +1,99 @@
|
|
|
+[env]
|
|
|
+# all workspace members can use this Makefile
|
|
|
+CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"
|
|
|
+PORT = "8000"
|
|
|
+
|
|
|
+# ---- BUILD & CREATE WASMS ----
|
|
|
+[tasks.compile]
|
|
|
+description = "Build"
|
|
|
+workspace = false
|
|
|
+command = "cargo"
|
|
|
+args = ["build"]
|
|
|
+
|
|
|
+[tasks.compile_release]
|
|
|
+description = "Build, with the --release flag"
|
|
|
+workspace = false
|
|
|
+command = "cargo"
|
|
|
+args = ["build", "--release"]
|
|
|
+
|
|
|
+[tasks.create_wasm]
|
|
|
+description = "Build with wasm-pack"
|
|
|
+install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V", min_version = "0.8.0" }
|
|
|
+command = "wasm-pack"
|
|
|
+args = ["build", "--target", "web", "--out-name", "package", "--dev"]
|
|
|
+
|
|
|
+[tasks.create_wasm_release]
|
|
|
+description = "Build with wasm-pack"
|
|
|
+install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V", min_version = "0.8.0" }
|
|
|
+command = "wasm-pack"
|
|
|
+args = ["build", "--target", "web", "--out-name", "package"]
|
|
|
+
|
|
|
+[tasks.build]
|
|
|
+description = "Build, and create wasms"
|
|
|
+workspace = false
|
|
|
+dependencies = ["compile", "create_wasm"]
|
|
|
+
|
|
|
+[tasks.build_release]
|
|
|
+description = "Build, and create wasms, with the release flag"
|
|
|
+workspace = false
|
|
|
+dependencies = ["compile_release", "create_wasm_release"]
|
|
|
+
|
|
|
+[tasks.watch]
|
|
|
+description = "Build, create wasms, and watch/recompile files for changes"
|
|
|
+workspace = false
|
|
|
+dependencies = ["build", "create_wasm"]
|
|
|
+watch = { ignore_pattern="pkg/*" }
|
|
|
+
|
|
|
+[tasks.serve]
|
|
|
+description = "Start server"
|
|
|
+install_crate = { crate_name = "microserver", binary = "microserver", test_arg = "-h" }
|
|
|
+workspace = false
|
|
|
+command = "microserver"
|
|
|
+args = ["--port", "${PORT}"]
|
|
|
+
|
|
|
+[tasks.start]
|
|
|
+description = "Combine the build and serve tasks"
|
|
|
+workspace = false
|
|
|
+dependencies = ["build", "serve"]
|
|
|
+
|
|
|
+
|
|
|
+# ---- LINT ----
|
|
|
+
|
|
|
+[tasks.clippy]
|
|
|
+description = "Lint with Clippy"
|
|
|
+clear = true
|
|
|
+workspace = false
|
|
|
+install_crate = { rustup_component_name = "clippy", binary = "cargo-clippy", test_arg = "--help" }
|
|
|
+command = "cargo"
|
|
|
+args = ["clippy", "--all-features", "--", "--deny", "warnings", "--deny", "clippy::pedantic", "--deny", "clippy::nursery"]
|
|
|
+
|
|
|
+[tasks.fmt]
|
|
|
+description = "Format with rustfmt"
|
|
|
+workspace = false
|
|
|
+dependencies = ["fmt"]
|
|
|
+
|
|
|
+
|
|
|
+# ---- 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", min_version = "0.8.0" }
|
|
|
+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"]
|