-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
113 lines (90 loc) · 2.63 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
102
103
104
105
106
107
108
109
110
111
112
113
[config]
skip_core_tasks = true
###################
## Manual Deploy ##
###################
[tasks.build-and-deploy]
run_task = [{name = [
"build-production",
"deploy-local",
]}]
[tasks.deploy-local]
script = ["firebase deploy --project ji-kids --only hosting:ji-kids-red-sea-race"]
##################
## Main Entries ##
##################
[tasks.build]
run_task = [
{name = "build-development", condition = { profiles = [ "development"] } },
{name = "build-production", condition = { profiles = [ "production"] } },
]
[tasks.watch]
command = "watchexec"
args = ["-w", "./src", "-w", "../../dakom/shipyard-scenegraph/crate/src", "makers", "build-development"]
[tasks.watch-quiet]
command = "watchexec"
args = ["-w", "./src", "-w", "../../dakom/shipyard-scenegraph/crate/src", "makers", "build-development-quiet"]
[tasks.clean]
script_runner = "@shell"
ignore_errors = true
script = [
"rm -rf ./target",
"rm -rf ./pkg",
"rm -rf ./_static/wasm/app",
"rm -rf ./dist"
]
#################
## Development ##
#################
[tasks.build-development]
run_task = [{name = [
"compile-development",
"bindgen-development"
]}]
[tasks.build-development-quiet]
run_task = [{name = [
"compile-development-quiet",
"bindgen-development"
]}]
[tasks.compile-development]
command = "cargo"
args = ["build","--features","dev","--target","wasm32-unknown-unknown"]
toolchain = "nightly"
[tasks.compile-development-quiet]
command = "cargo"
args = ["build","--features","dev quiet","--target","wasm32-unknown-unknown"]
toolchain = "nightly"
[tasks.bindgen-development]
command = "wasm-bindgen"
args = ["./target/wasm32-unknown-unknown/debug/app.wasm","--debug", "--keep-debug", "--target","web","--out-dir","./_static/wasm/app/pkg"]
################
## Production ##
################
[tasks.build-production]
run_task = [{name = [
"clean-dist",
"compile-production",
"bindgen-production",
"wasmopt-production",
"copy-static",
]}]
[tasks.compile-production]
command = "cargo"
args = ["build","--release","--target","wasm32-unknown-unknown"]
toolchain = "nightly"
[tasks.bindgen-production]
command = "wasm-bindgen"
args = ["./target/wasm32-unknown-unknown/release/app.wasm", "--target","web","--out-dir","./_static/wasm/app/pkg"]
[tasks.wasmopt-production]
command = "wasm-opt"
# if CI fails, try with BINARYEN_CORES=1 in an env
args = ["-O3","-o","./_static/wasm/app/pkg/app_bg.wasm", "./_static/wasm/app/pkg/app_bg.wasm"]
##################
## Copy Static ##
#################
[tasks.clean-dist]
script_runner = "@shell"
script = ["rm -rf ./dist/"]
[tasks.copy-static]
script_runner = "@shell"
script = ["cp -R ./_static/* ./dist/"]