-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
79 lines (64 loc) · 1.92 KB
/
Copy pathjustfile
File metadata and controls
79 lines (64 loc) · 1.92 KB
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
# cc-sessions justfile
version := `grep '^version' Cargo.toml | head -1 | cut -d'"' -f2`
apple_targets := "aarch64-apple-darwin x86_64-apple-darwin"
linux_targets := "aarch64-unknown-linux-musl x86_64-unknown-linux-musl"
# Default recipe - show available commands
default:
@just --list
# Build release binary
build:
cargo build --release
# Run tests
test:
cargo test
# Build and install to ~/.local/bin (with macOS signing)
install: build
cp target/release/cc-sessions ~/.local/bin/
@if [ "$(uname)" = "Darwin" ]; then \
codesign -s - -f ~/.local/bin/cc-sessions; \
fi
# One-time: install cross-compilation prerequisites
cross-setup:
rustup target add {{apple_targets}} {{linux_targets}}
@command -v cargo-zigbuild >/dev/null || cargo install --locked cargo-zigbuild
@command -v zig >/dev/null || { echo "zig not found -- run: brew install zig"; exit 1; }
# Cross-compile release binaries for mac+linux, arm+x86
build-all:
@for t in {{apple_targets}}; do \
echo "==> $t"; \
cargo build --release --target $t || exit 1; \
done
@for t in {{linux_targets}}; do \
echo "==> $t"; \
cargo zigbuild --release --target $t || exit 1; \
done
# Package per-target tarballs into dist/
dist: build-all
rm -rf dist
mkdir -p dist
@for t in {{apple_targets}} {{linux_targets}}; do \
out="dist/cc-sessions-{{version}}-$t.tar.gz"; \
tar --no-xattrs -czf "$out" -C "target/$t/release" cc-sessions; \
done
@ls -lh dist/
# Run with arguments (e.g., just run -- --list)
run *ARGS:
cargo run --release -- {{ARGS}}
# Check code without building
check:
cargo check
# Format code
fmt:
cargo fmt
# Lint with clippy
lint:
cargo clippy -- -D warnings
# Clean build artifacts
clean:
cargo clean
# Watch for changes and run tests
watch-test:
cargo watch -x test
# Watch for changes and check
watch:
cargo watch -x check