-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (67 loc) · 3 KB
/
Copy pathMakefile
File metadata and controls
85 lines (67 loc) · 3 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
80
81
82
83
84
85
# SolverForge Calendar Makefile
GREEN := \033[92m
CYAN := \033[96m
YELLOW := \033[93m
RED := \033[91m
BOLD := \033[1m
RESET := \033[0m
CHECK := ✓
CROSS := ✗
ARROW := ▸
VERSION := $(shell grep -m1 '^version' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
.PHONY: help build build-release run run-cli test lint fmt fmt-check clippy ci-local pre-release clean version
.DEFAULT_GOAL := help
help:
@printf "$(CYAN)$(BOLD)SolverForge Calendar$(RESET) v$(VERSION)\n\n"
@printf "$(ARROW) build Build the TUI and CLI binaries\n"
@printf "$(ARROW) build-release Build optimized binaries\n"
@printf "$(ARROW) run Launch the TUI\n"
@printf "$(ARROW) run-cli Run the agent CLI, pass ARGS='...'\n"
@printf "$(ARROW) test Run the full test suite\n"
@printf "$(ARROW) lint Run formatting and clippy checks\n"
@printf "$(ARROW) fmt Format the repo\n"
@printf "$(ARROW) fmt-check Check formatting without rewriting\n"
@printf "$(ARROW) clippy Run clippy with CI flags\n"
@printf "$(ARROW) ci-local Simulate the GitHub Actions workflow\n"
@printf "$(ARROW) pre-release Run release-oriented validation\n"
@printf "$(ARROW) clean Remove build artifacts\n"
@printf "$(ARROW) version Print the current crate version\n\n"
build:
@printf "$(ARROW) Building binaries...\n"
@cargo build --bins && printf "$(GREEN)$(CHECK) Build passed$(RESET)\n" || (printf "$(RED)$(CROSS) Build failed$(RESET)\n" && exit 1)
build-release:
@printf "$(ARROW) Building release binaries...\n"
@cargo build --release --bins && printf "$(GREEN)$(CHECK) Release build passed$(RESET)\n" || (printf "$(RED)$(CROSS) Release build failed$(RESET)\n" && exit 1)
run:
@cargo run
run-cli:
@cargo run --bin solverforge-calendar-cli -- $(ARGS)
test:
@printf "$(ARROW) Running tests...\n"
@cargo test && printf "$(GREEN)$(CHECK) Tests passed$(RESET)\n" || (printf "$(RED)$(CROSS) Tests failed$(RESET)\n" && exit 1)
fmt:
@cargo fmt --all
fmt-check:
@printf "$(ARROW) Checking formatting...\n"
@cargo fmt --all --check && printf "$(GREEN)$(CHECK) Formatting valid$(RESET)\n" || (printf "$(RED)$(CROSS) Formatting issues found$(RESET)\n" && exit 1)
clippy:
@printf "$(ARROW) Running clippy...\n"
@cargo clippy --bins --tests -- -D warnings && printf "$(GREEN)$(CHECK) Clippy passed$(RESET)\n" || (printf "$(RED)$(CROSS) Clippy failed$(RESET)\n" && exit 1)
lint: fmt-check clippy
@printf "$(GREEN)$(CHECK) Lint checks passed$(RESET)\n"
ci-local: fmt-check clippy
@printf "$(ARROW) Building binaries...\n"
@cargo build --bins
@printf "$(ARROW) Running tests...\n"
@cargo test
@printf "$(GREEN)$(BOLD)$(CHECK) Local CI passed$(RESET)\n"
pre-release: fmt-check clippy
@printf "$(ARROW) Building release binaries...\n"
@cargo build --release --bins
@printf "$(ARROW) Running release validation tests...\n"
@cargo test
@printf "$(GREEN)$(BOLD)$(CHECK) Pre-release checks passed for v$(VERSION)$(RESET)\n"
clean:
@cargo clean
version:
@printf "$(YELLOW)$(BOLD)$(VERSION)$(RESET)\n"