-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
156 lines (126 loc) · 4.5 KB
/
Copy pathMakefile
File metadata and controls
156 lines (126 loc) · 4.5 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
## Variables
CARGO ?= cargo
PACKAGE ?= project-browser
# Exclude the Tauri app from QA to avoid requiring a built frontend during lint/check/test
QA_EXCLUDES ?= --exclude app
## Composite targets
.PHONY: all setup build run check fmt fmt-fix lint test qa clean help
all: build
help: ## Show this help message
@echo "Available targets:"
@echo ""
@echo "Build & Development:"
@echo " all - Build the project (default target)"
@echo " setup - Install Rust components (clippy, rustfmt)"
@echo " build - Build the workspace"
@echo " run - Run the application (with analysis features)"
@echo " clean - Clean build artifacts"
@echo ""
@echo "Code Quality:"
@echo " check - Run cargo check on workspace"
@echo " fmt - Check code formatting"
@echo " fmt-fix - Auto-format code in-place"
@echo " lint - Run clippy linter"
@echo " test - Run tests"
@echo " qa - Run full QA pipeline (fmt-fix, lint, check, test)"
@echo ""
@echo "CLI Convenience:"
@echo " run-scan - Scan $$HOME/Code directory"
@echo " run-list - List recent projects (limit 50)"
@echo " db-path - Show database path"
@echo ""
@echo "CLI with Analysis Features:"
@echo " run-scan-analyzed - Scan with git & analyzer features"
@echo " run-list-analyzed - List projects with LOC info"
@echo ""
@echo "Tauri App:"
@echo " tauri-run - Run Tauri desktop app"
@echo " tauri-run-analyzed - Run Tauri app with analysis features"
@echo ""
@echo "Version Management:"
@echo " version-show - Show current versions from all files"
@echo " version-check - Check if versions are synchronized"
@echo " version-bump-patch - Bump patch version (x.y.Z)"
@echo " version-bump-minor - Bump minor version (x.Y.z)"
@echo " version-bump-major - Bump major version (X.y.z)"
@echo " version-bump-patch-commit - Bump patch and commit changes"
@echo " version-bump-patch-tag - Bump patch, commit, and create tag"
@echo ""
@echo "Web Frontend:"
@echo " web-build - Build web frontend"
@echo " web-dev - Start web development server"
@echo " web-preview - Preview built web frontend"
@echo ""
@echo "Use 'make <target>' to run a specific target."
setup:
@echo "Installing Rust components (clippy, rustfmt)"
rustup component add clippy rustfmt || true
build:
@echo "Building web frontend..."
$(MAKE) web-build
@echo "Building Rust workspace..."
$(CARGO) build --workspace
run:
@echo "Running application with analysis features..."
$(MAKE) tauri-run-analyzed
check:
$(CARGO) check --workspace --all-targets $(QA_EXCLUDES)
fmt:
$(CARGO) fmt --all -- --check
# Auto-format code in-place
fmt-fix:
$(CARGO) fmt --all
lint:
$(CARGO) clippy --workspace --all-targets $(QA_EXCLUDES) -- -D warnings
test:
$(CARGO) test --workspace --all-targets $(QA_EXCLUDES) -- --nocapture
# QA auto-fixes formatting, then runs lints, checks, tests, and build
qa: fmt-fix lint check test
clean:
$(CARGO) clean
# Convenience run targets
.PHONY: run-scan run-list db-path
run-scan:
$(CARGO) run -p cli -- scan --root $$HOME/Code
run-list:
$(CARGO) run -p cli -- list --sort recent --limit 50
db-path:
$(CARGO) run -p cli -- config --db-path
.PHONY: run-scan-analyzed run-list-analyzed tauri-run-analyzed
run-scan-analyzed:
$(CARGO) run -p cli -F git,analyzers -- scan --root $$HOME/Code
run-list-analyzed:
$(CARGO) run -p cli -F git,analyzers -- list --sort loc --limit 50 --show-loc
tauri-run-analyzed:
$(CARGO) run -p app -F git,analyzers
.PHONY: tauri-run
tauri-run:
# Ensure frontend is built before launching Tauri
@if [ ! -d dist ]; then \
echo "Building web frontend (dist/ missing)..."; \
$(MAKE) web-build; \
fi
$(CARGO) run -p app
.PHONY: web-build web-dev web-preview
web-build:
npm --prefix web run build
web-dev:
npm --prefix web run dev
web-preview:
npm --prefix web run preview
# Version management targets
.PHONY: version-show version-check version-bump-patch version-bump-minor version-bump-major version-bump-patch-commit version-bump-patch-tag
version-show:
$(CARGO) run -p version-manager -- show
version-check:
$(CARGO) run -p version-manager -- check
version-bump-patch:
$(CARGO) run -p version-manager -- bump patch
version-bump-minor:
$(CARGO) run -p version-manager -- bump minor
version-bump-major:
$(CARGO) run -p version-manager -- bump major
version-bump-patch-commit:
$(CARGO) run -p version-manager -- bump patch --commit
version-bump-patch-tag:
$(CARGO) run -p version-manager -- bump patch --commit --tag