-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
101 lines (82 loc) · 2.19 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
[config]
default_to_workspace = false
additional_profiles = ["debug"]
[tasks.set-vars.env]
RUSTFLAGS = "-Copt-level=s"
MODE = "release"
[tasks.set-vars.env.debug]
RUSTFLAGS = ""
MODE = "debug"
[tasks.build-client-debug]
command = "cargo"
toolchain = "stable"
args = ["build", "-p", "client", "--target", "wasm32-unknown-unknown"]
[tasks.build-client-release]
extend = "build-client-debug"
args = ["build", "-p", "client", "--target", "wasm32-unknown-unknown", "--release"]
[tasks.build-client]
run_task = [
{ name = "build-client-debug", condition = { env = { MODE = "debug" } } },
{ name = "build-client-release", condition = { env = { MODE = "release" } } },
]
dependencies = ["set-vars"]
[tasks.copy-static-files]
script_runner = "@duckscript"
script = '''
rm -r target/web
glob_cp examples/client/web/static/**/* target/web/
'''
[tasks.rollup-scripts]
command = "npx"
args = [
"rollup",
"-p",
"@rollup/plugin-node-resolve",
"examples/client/web/material_web.index.js",
"-o",
"target/web/material_web.bundle.js",
]
[tasks.deploy-client]
command = "wasm-bindgen"
args = [
"--target",
"web",
"--no-typescript",
"--out-dir",
"target/web",
"--out-name",
"client",
"target/wasm32-unknown-unknown/${MODE}/client.wasm",
]
dependencies = ["set-vars", "copy-static-files", "rollup-scripts"]
[tasks.client]
dependencies = ["build-client", "deploy-client"]
[tasks.run-server-debug]
command = "cargo"
toolchain = "stable"
args = ["run", "-p", "server", "--release"]
[tasks.run-server-release]
extend = "run-server-debug"
args = ["run", "-p", "server", "--release"]
[tasks.run]
run_task = [
{ name = "run-server-debug", condition = { env = { MODE = "debug" } } },
{ name = "run-server-release", condition = { env = { MODE = "release" } } },
]
dependencies = ["client"]
[tasks.watch]
toolchain = "stable"
command = "cargo"
args = ["watch", "-w", "examples/client", "-x", "make client"]
[tasks.fmt]
command = "cargo"
toolchain = "nightly"
args = ["fmt"]
[tasks.fmt-check]
command = "cargo"
toolchain = "nightly"
args = ["fmt", "--", "--check"]
[tasks.clippy]
command = "cargo"
toolchain = "stable"
args = ["clippy", "--all-targets", "--all-features"]