-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
65 lines (56 loc) · 1.75 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
[env]
PORT = "8000"
[config]
skip_core_tasks = true
# ---- BASIC ----
[tasks.watch]
description = "Watch files and recompile the project on change"
run_task = [{ name = "build" }]
watch = { no_git_ignore = true, watch = ["./src/", "Cargo.toml"] }
[tasks.serve]
description = "Start server"
install_crate = { crate_name = "miniserve", binary = "miniserve", test_arg = "-h" }
command = "miniserve"
args = [".", "--index", "index.html", "--port", "${PORT}", "--verbose"]
[tasks.verify]
description = "Format, lint with Clippy and run tests"
dependencies = ["fmt", "clippy"]
# ---- BUILD ----
[tasks.build]
description = "Build with wasm-pack"
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
command = "wasm-pack"
args = ["build", "--target", "web", "--out-name", "package", "--dev"]
[tasks.build_release]
description = "Build with wasm-pack in release mode"
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
command = "wasm-pack"
args = ["build", "--target", "web", "--out-name", "package"]
[tasks.release]
description = "Generate release folder for deployment"
dependencies = ["build_release"]
script_runner = "@shell"
script = """
mkdir -p release/pkg
cp -r static/ index.html release/
cp pkg/package_bg.wasm pkg/package.js release/pkg
"""
# ---- LINT ----
[tasks.clippy]
description = "Lint with Clippy"
install_crate = { rustup_component_name = "clippy", binary = "cargo-clippy", test_arg = "--help" }
command = "cargo"
args = [
"clippy",
"--all-features",
"--",
"--deny",
"warnings",
"--deny",
"clippy::nursery"
]
[tasks.fmt]
description = "Format with rustfmt"
install_crate = { rustup_component_name = "rustfmt", binary = "rustfmt", test_arg = "-V" }
command = "cargo"
args = ["fmt"]