-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (82 loc) · 3.04 KB
/
Makefile
File metadata and controls
101 lines (82 loc) · 3.04 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
.PHONY: build release test test-unit run package dist tap-smoke install-cli clean docker-up docker-down docker-logs lint icon help
SIGNING_MODE ?= adhoc
# Default target
help:
@echo "THOR — Mac-to-Jetson Robotics Control Plane"
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "Development:"
@echo " build Build all targets (debug)"
@echo " release Build all targets (release)"
@echo " test Run the full suite (starts Docker sims if daemon is available)"
@echo " test-unit Run unit tests only (no Docker needed)"
@echo " run Build, package, and launch the app"
@echo " package Package .app bundle (release)"
@echo " dist Build release artifacts into dist/"
@echo " tap-smoke Install the formula from a temporary local tap"
@echo " icon Generate app icon from assets"
@echo " clean Remove build artifacts"
@echo ""
@echo "Docker Simulator:"
@echo " docker-up Start Jetson simulators"
@echo " docker-down Stop Jetson simulators"
@echo " docker-logs View simulator logs"
@echo ""
@echo "CLI:"
@echo " install-cli Install thorctl to /usr/local/bin"
@echo " thorctl Run thorctl with ARGS (e.g. make thorctl ARGS='health')"
@echo ""
@echo "Quality:"
@echo " lint Run SwiftLint (if installed)"
@echo " stats Show project statistics"
# Build
build:
Scripts/dev/swiftw build
release:
Scripts/dev/swiftw build -c release
# Test
test:
Scripts/dev/run_tests.sh all
test-unit:
Scripts/dev/run_tests.sh unit
# Run
run: package
@pkill -f "THORApp.app/Contents/MacOS/THORApp" 2>/dev/null || true
@open THORApp.app
package:
SIGNING_MODE=$(SIGNING_MODE) Scripts/package_app.sh release
dist:
SIGNING_MODE=$(SIGNING_MODE) Scripts/release/create_dist.sh release
tap-smoke:
Scripts/release/tap_smoke.sh
icon:
Scripts/dev/generate_icon.sh
# Docker
docker-up:
docker compose up -d
docker-down:
docker compose down
docker-logs:
docker compose logs -f
# CLI
install-cli: release
@echo "Installing thorctl to /usr/local/bin..."
@cp .build/release/thorctl /usr/local/bin/thorctl
@echo "Done. Run 'thorctl help' to get started."
thorctl:
Scripts/dev/swiftw run thorctl $(ARGS)
# Quality
lint:
@which swiftlint >/dev/null 2>&1 && swiftlint lint --strict || echo "SwiftLint not installed. Run: brew install swiftlint"
stats:
@echo "=== THOR Project Stats ==="
@echo "Files: $$(find . -type f -not -path './.build/*' -not -path './THORApp.app/*' -not -path './.git/*' -not -name '.DS_Store' -not -name 'Package.resolved' | wc -l | tr -d ' ')"
@echo "Lines: $$(find . -type f -not -path './.build/*' -not -path './THORApp.app/*' -not -path './.git/*' -not -name '.DS_Store' -not -name 'Package.resolved' | xargs wc -l 2>/dev/null | tail -1 | awk '{print $$1}')"
@echo "Commits: $$(git log --oneline | wc -l | tr -d ' ')"
@echo "Tests: $$(Scripts/dev/swiftw test 2>&1 | grep 'Test run' | grep -oE '[0-9]+ tests' | head -1)"
@echo "TODOs: $$(rg TODO Sources/ 2>/dev/null | wc -l | tr -d ' ')"
# Clean
clean:
swift package clean
rm -rf THORApp.app .build/THOR.iconset dist