-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
61 lines (49 loc) · 2.17 KB
/
justfile
File metadata and controls
61 lines (49 loc) · 2.17 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
# Simple project tasks
build:
cargo build
test:
cargo test --all
# Run an example binary with default input dataset matching the bin name
# Usage:
# just run wordcount
# just run sliding_avg
run bin:
cargo run -p pulse-examples --bin {{bin}} -- pulse-examples/examples/{{bin}}.jsonl
# Run an example binary with a custom input file
# Usage:
# just run sliding_avg pulse-examples/examples/sliding_avg.jsonl
# just run wordcount C:/data/my_words.jsonl
run-with-input bin input:
cargo run -p pulse-examples --bin {{bin}} -- {{input}}
# Run an example and save output to a file using the default dataset
# Usage:
# just run-to-file sliding_avg out.jsonl
run-to-file bin out:
cargo run -p pulse-examples --bin {{bin}} -- pulse-examples/examples/{{bin}}.jsonl | Out-File -Encoding utf8 {{out}}
# Run an example with a custom input file and save output to a file
# Usage:
# just run-to-file-with-input sliding_avg pulse-examples/examples/sliding_avg.jsonl out.jsonl
run-to-file-with-input bin input out:
cargo run -p pulse-examples --bin {{bin}} -- {{input}} | Out-File -Encoding utf8 {{out}}
# Ensure outputs directory exists (PowerShell)
ensure-outputs:
pwsh.exe -NoLogo -NoProfile -Command "New-Item -ItemType Directory -Force outputs | Out-Null"
# Run an example with default dataset and write to outputs/{{bin}}.jsonl
# Usage:
# just run-to-outputs sliding_avg
run-to-outputs bin: ensure-outputs
pwsh.exe -NoLogo -NoProfile -Command "cargo run -p pulse-examples --bin {{bin}} -- pulse-examples/examples/{{bin}}.jsonl | Out-File -Encoding utf8 outputs/{{bin}}.jsonl"
# Run an example with a custom input file and write to outputs/{{bin}}.jsonl
# Usage:
# just run-to-outputs-with-input sliding_avg pulse-examples/examples/sliding_avg.jsonl
run-to-outputs-with-input bin input: ensure-outputs
pwsh.exe -NoLogo -NoProfile -Command "cargo run -p pulse-examples --bin {{bin}} -- {{input}} | Out-File -Encoding utf8 outputs/{{bin}}.jsonl"
# Format the workspace
format:
cargo fmt --all
# Lint with clippy and treat warnings as errors
clippy:
cargo clippy --all-targets -- --deny warnings
# Generate documentation
docs:
cargo doc --open --workspace --no-deps