OXYGENHUB
# f2d2776b2a14 oxygenhub / Makefile
2.1 KiB · Makefile · last changed Changelog per change: a check in the gate, and Unreleased caught up 17 days ago source blame history raw
17ca6cdd Andy McCall ↶ 1
.PHONY: build check test fmt clippy run deploy ts backdrop backdrop-check
d23464c0 Andy McCall ↶ 2
3
build:
4
	cargo build --release
5
b9eb70fb Andy McCall ↶ 6
check: changelog fmt clippy test
d23464c0 Andy McCall ↶ 7
b9eb70fb Andy McCall ↶ 8
# A code change needs a CHANGELOG.md line (scripts/changelog-check.sh).
9
changelog:
10
	scripts/changelog-check.sh
11
d23464c0 Andy McCall ↶ 12
fmt:
13
	cargo fmt --all -- --check
14
15
clippy:
16
	cargo clippy --workspace --all-targets -- -D warnings
17
18
test:
19
	cargo test --workspace
20
21
run:
22
	cargo run -- --data data serve
23
b64e2537 Andy McCall ↶ 24
# TypeScript declarations of the API types, for the VS Code extensions.
25
ts:
26
	cargo run -q -p hub-api --bin hub-api-typescript > crates/hub-api/ts/index.d.ts
27
d23464c0 Andy McCall ↶ 28
# Developer edition on Earth (docs/deploy.md).
29
deploy:
42fa9554 Andy McCall ↶ 30
	rsync -a --delete --exclude target --exclude node_modules --exclude .oxy/objects/loose ../oxygen ../oxygenflow ../oxygenhub claude@earth:src/
e9bfea8e Andy McCall ↶ 31
	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"
380996db Andy McCall ↶ 32
25091e5c Andy McCall ↶ 33
# Move the pinned oxygenflow (deps/oxygenflow) to its main on Earth, with the
34
# oxygen it pins; the next commit records the new pin. Push oxygen, then
35
# oxygenflow (with `make pins` there), first.
380996db Andy McCall ↶ 36
.PHONY: pins
37
pins:
046bd71a Andy McCall ↶ 38
	cd deps/oxygenflow && oxy --plain pull origin && oxy --plain submodule update --init
17ca6cdd Andy McCall ↶ 39
40
# Backdrops (docs/backgrounds.md): build the engine (crates/backdrop, a
41
# workspace of its own) for wasm32 and write its .wasm and wasm-bindgen glue
42
# to assets/backdrop/, which the hub embeds and which are committed, so the
43
# hub build and its CI need no wasm toolchain. Needs the wasm32-unknown-unknown
44
# target and wasm-bindgen-cli at the version in crates/backdrop/Cargo.lock.
45
backdrop:
46
	cd crates/backdrop && cargo build --release --target wasm32-unknown-unknown
47
	wasm-bindgen --target web --no-typescript --out-dir assets/backdrop crates/backdrop/target/wasm32-unknown-unknown/release/backdrop.wasm
48
49
backdrop-check:
50
	cd crates/backdrop && cargo fmt --check && cargo clippy --target wasm32-unknown-unknown -- -D warnings && cargo test