forked from chaoticgood1/ironverse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
72 lines (58 loc) · 2.17 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
[config]
default_to_workspace = false
[tasks.web]
dependencies = ["clear", "compile_wasm", "serve"]
[tasks.web_opt]
dependencies = ["clear", "compile_wasm_opt", "serve"]
[tasks.deploy]
dependencies = ["compile_wasm_opt", "deploy_wasm"]
[tasks.deploy_serve]
dependencies = ["compile_wasm_opt", "deploy_wasm", "serve_deployed"]
[tasks.compile_wasm]
script = '''
wasm-pack build --out-dir ../../bin/editor/wasm/multithread --target no-modules ./crates/lib/multithread/
cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --out-name app --out-dir crates/bin/editor/wasm --target web target/wasm32-unknown-unknown/release/editor.wasm
'''
[tasks.serve]
script = '''
echo "LOCAL: [http://localhost:4000]" && basic-http-server -a 0.0.0.0:4000 ./crates/bin/editor/
'''
[tasks.web_editor]
dependencies = ["clear", "compile_editor", "serve"]
[tasks.compile_editor]
script = '''
cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --out-name app --out-dir crates/bin/editor/wasm --target web target/wasm32-unknown-unknown/release/editor.wasm
'''
[tasks.clear]
script = '''
clear
clear
'''
[tasks.editor]
script = '''
clear
clear
cargo run -p editor
'''
[tasks.compile_wasm_opt]
script = '''
wasm-pack build --release --out-dir ../../bin/editor/wasm/multithread --target no-modules ./crates/lib/multithread/
wasm-opt -Oz --output crates/bin/editor/wasm/multithread/multithread_bg.wasm crates/bin/editor/wasm/multithread/multithread_bg.wasm
cargo build --profile wasm-release --target wasm32-unknown-unknown
wasm-bindgen --out-name app --out-dir crates/bin/editor/wasm --target web target/wasm32-unknown-unknown/wasm-release/editor.wasm
wasm-opt -Oz --output crates/bin/editor/wasm/app_bg.wasm crates/bin/editor/wasm/app_bg.wasm
'''
[tasks.deploy_wasm]
script = '''
duck -e "cp ./crates/bin/editor/index.html ./docs/index.html"
duck -e "cp ./crates/bin/editor/multithread.js ./docs/multithread.js"
duck -e "cp ./crates/bin/editor/wasm ./docs"
duck -e "cp ./crates/bin/editor/wasm/multithread ./docs/wasm"
duck -e "cp ./crates/bin/editor/assets ./docs"
'''
[tasks.serve_deployed]
script = '''
echo "LOCAL: [http://localhost:4000]" && basic-http-server -a 0.0.0.0:4000 ./docs/
'''