forked from NiklasEi/bevy_game_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
79 lines (62 loc) · 2.76 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
# This make file contains tasks for the web build of the game
# Serve the web version locally by running `cargo make serve`
# Build a web release by running `cargo make release` (release is the `build/web` directory)
[env]
TARGET_DIR = "target/wasm32-unknown-unknown/release/"
[tasks.release]
dependencies = ["build-and-bind-wasm", "copy-files-for-release"]
[tasks.serve]
command = "basic-http-server"
args = ["-x", "build/web/"]
dependencies = ["build-and-bind-wasm", "copy-files-for-release", "basic-http-server"]
[tasks.build-and-bind-wasm]
args = ["--out-dir", "${TARGET_DIR}", "--out-name", "wasm", "--target", "web", "--no-typescript", "${TARGET_DIR}${CARGO_MAKE_CRATE_NAME}.wasm"]
command = "wasm-bindgen"
dependencies = ["cargo-build-web", "wasm-bindgen-cli"]
[tasks.cargo-build-web]
args = ["build", "--target", "wasm32-unknown-unknown", "--features", "web", "--release"]
command = "cargo"
# Due to https://github.com/mrk-its/bevy_webgl2/issues/35 we need a specific version at the moment
[tasks.wasm-bindgen-cli]
#install_crate = {crate_name = "wasm-bindgen-cli", binary = "wasm-bindgen", test_arg="--help"}
command = "cargo"
args = ["install", "wasm-bindgen-cli", "--force", "--version", "0.2.69"]
[tasks.basic-http-server]
install_crate = {crate_name = "basic-http-server", binary = "basic-http-server", test_arg="--help"}
[tasks.copy-files-for-release]
dependencies = ["copy-wasm-to-build-dir", "copy-wasm-js-to-build-dir", "copy-wasm_bg-to-build-dir", "copy-index-to-build-dir", "copy-assets-to-build-dir", "copy-credits-to-build-dir"]
[tasks.copy-wasm-to-build-dir]
args = ["${TARGET_DIR}${CARGO_MAKE_CRATE_NAME}.wasm", "build/web/target/"]
command = "cp"
dependencies = ["create-build-dir", "build-and-bind-wasm"]
[tasks.copy-wasm-js-to-build-dir]
args = ["${TARGET_DIR}wasm.js", "build/web/target/"]
command = "cp"
dependencies = ["create-build-dir", "build-and-bind-wasm"]
[tasks.copy-wasm_bg-to-build-dir]
args = ["${TARGET_DIR}wasm_bg.wasm", "build/web/target/"]
command = "cp"
dependencies = ["create-build-dir", "build-and-bind-wasm"]
[tasks.copy-assets-to-build-dir]
args = ["-r", "assets", "build/web/"]
command = "cp"
dependencies = ["create-build-dir"]
[tasks.copy-credits-to-build-dir]
args = ["-r", "credits", "build/web/"]
command = "cp"
dependencies = ["create-build-dir"]
[tasks.copy-index-to-build-dir]
args = ["index.html", "build/web/"]
command = "cp"
dependencies = ["create-build-dir", "prepare-favicon"]
[tasks.prepare-favicon]
args = ["build/web/icon.ico", "build/web/favicon.ico"]
command = "mv"
dependencies = ["create-build-dir", "copy-favicon-to-build-dir"]
[tasks.copy-favicon-to-build-dir]
args = ["build/windows/icon.ico", "build/web/"]
command = "cp"
dependencies = ["create-build-dir"]
[tasks.create-build-dir]
args = ["-p", "build/web/target"]
command = "mkdir"