OXYGENHUB
◆ v0.5.2 oxygenhub / Makefile
2.0 KiB · Makefile · last changed feat(web): Backdrops, the engine in Rust and WASM, and the dashboard's Your sky (refs #157) 22 days ago source blame history raw
1
.PHONY: build check test fmt clippy run deploy ts backdrop backdrop-check
2
3
build:
4
	cargo build --release
5
6
check: fmt clippy test
7
8
fmt:
9
	cargo fmt --all -- --check
10
11
clippy:
12
	cargo clippy --workspace --all-targets -- -D warnings
13
14
test:
15
	cargo test --workspace
16
17
run:
18
	cargo run -- --data data serve
19
20
# TypeScript declarations of the API types, for the VS Code extensions.
21
ts:
22
	cargo run -q -p hub-api --bin hub-api-typescript > crates/hub-api/ts/index.d.ts
23
24
# Developer edition on Earth (docs/deploy.md).
25
deploy:
26
	rsync -a --delete --exclude target --exclude node_modules --exclude .oxy/objects/loose --exclude images/rust/vendor --exclude images/rust/npm-cache --exclude images/rust/warm ../oxygen ../oxygenflow ../oxygenhub claude@earth:src/
27
	B="$$(oxy --plain describe 2>/dev/null)"; ssh claude@earth "source ~/.cargo/env && cd src/oxygenhub && OXY_BUILD='$$B' cargo build --release && sudo install -m 0755 target/release/oxygenhub /usr/local/bin/oxygenhub && sudo systemctl restart oxygenhub && systemctl is-active oxygenhub"
28
29
# Move the pinned oxygenflow (deps/oxygenflow) to its main on Earth, with the
30
# oxygen it pins; the next commit records the new pin. Push oxygen, then
31
# oxygenflow (with `make pins` there), first.
32
.PHONY: pins
33
pins:
34
	cd deps/oxygenflow && oxy --plain pull origin && oxy --plain submodule update --init
35
36
# Backdrops (docs/backgrounds.md): build the engine (crates/backdrop, a
37
# workspace of its own) for wasm32 and write its .wasm and wasm-bindgen glue
38
# to assets/backdrop/, which the hub embeds and which are committed, so the
39
# hub build and its CI need no wasm toolchain. Needs the wasm32-unknown-unknown
40
# target and wasm-bindgen-cli at the version in crates/backdrop/Cargo.lock.
41
backdrop:
42
	cd crates/backdrop && cargo build --release --target wasm32-unknown-unknown
43
	wasm-bindgen --target web --no-typescript --out-dir assets/backdrop crates/backdrop/target/wasm32-unknown-unknown/release/backdrop.wasm
44
45
backdrop-check:
46
	cd crates/backdrop && cargo fmt --check && cargo clippy --target wasm32-unknown-unknown -- -D warnings && cargo test