-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
89 lines (73 loc) · 2.66 KB
/
Justfile
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
80
81
82
83
84
85
86
87
88
89
# PowerShell Core has all the Unix shell skills we need, such as || and &&
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
# Build all Rust binaries and run all tests
test: build
cargo nextest run
coverage:
# The first two commands are expected to fail, since "run" is just a hack to get llvm-cov to compile the binaries.
-cargo llvm-cov --all-features --hide-instantiations --bin=brr run -- x
-cargo llvm-cov --all-features --hide-instantiations --no-clean run -- x
cargo llvm-cov --open --all-features --hide-instantiations --no-clean nextest
# Run checks and formatting
check:
-cargo clippy --workspace --tests
-cargo fmt --all
# Run spcasm
spcasm *ARGS: build-spcasm
cargo run -- {{ARGS}}
# Build everything
build:
cargo build --workspace
# Build spcasm
build-spcasm:
cargo build --bin spcasm
fastrelease:
cargo build --workspace --profile=spcasm-fastrelease
pgo-release:
cargo pgo build
cargo pgo test
cargo pgo bench --keep-profiles
cargo pgo optimize
web:
cd spcasm-web && trunk serve --features console_error_panic_hook
# Build all documentation
doc:
cargo doc --no-deps --bin spcasm
cd doc && mdbook build
# Build and serve documentation locally
doc-watch:
cd doc && mdbook serve
# Assemble the website
website url="/":
cd spcasm-web && trunk build --dist ../site --release --no-default-features --public-url {{url}}
just doc
cp -rT doc/book/html site/doc
cp -rT target/doc site/doc/api
# Create a new spcasm release from a Windows machine
[windows]
release version: release-build-common && (release-finalize-common version)
wsl just release-build-common
# Create a new spcasm release from a Unix machine
[unix]
release version: release-build-common && (release-finalize-common version)
release-build-common: test check
cargo build -q --profile=spcasm-release
release-finalize-common version:
mkdir 'spcasm-{{version}}'
cp target/spcasm-release/spcasm.exe 'spcasm-{{version}}'
cp target/spcasm-release/spcasm 'spcasm-{{version}}'
cp target/spcasm-release/brr.exe 'spcasm-{{version}}'
cp target/spcasm-release/brr 'spcasm-{{version}}'
@echo '======================================================================='
@echo 'spcasm and brr version(s)'
wsl './spcasm-{{version}}/spcasm' --version
./spcasm-{{version}}/spcasm.exe --version
wsl './spcasm-{{version}}/brr' --version
./spcasm-{{version}}/brr.exe --version
cd doc && mdbook build
wsl -e cp -rT include 'spcasm-{{version}}/include'
cd spcasm-{{version}} && zip spcasm-{{version}}.zip '*' 'include/*' -x spcasm brr
wsl -e tar -caz --exclude '*.exe' --exclude '*.zip' -f spcasm-{{version}}.tar.xz -C spcasm-{{version}} .
mv spcasm-{{version}}.tar.xz spcasm-{{version}}
clean:
cargo clean -r