OXYGENHUB
◆ v0.9.2 oxygenhub / Makefile
2.1 KiB · Makefile · last changed Changelog per change: a check in the gate, and Unreleased caught up 16 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: changelog fmt clippy test
7
8
# A code change needs a CHANGELOG.md line (scripts/changelog-check.sh).
9
changelog:
10
	scripts/changelog-check.sh
11
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
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
28
# Developer edition on Earth (docs/deploy.md).
29
deploy:
30
	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/
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"
32
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.
36
.PHONY: pins
37
pins:
38
	cd deps/oxygenflow && oxy --plain pull origin && oxy --plain submodule update --init
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