-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (51 loc) · 1.72 KB
/
Makefile
File metadata and controls
61 lines (51 loc) · 1.72 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
.PHONY: setup build test fmt clippy check sync-protos sync-protos-local check-protos
SPEC_PROTO_DIR := ../multiagentcoordinationprotocol/schemas/proto
PROTO_FILES := macp/v1/envelope.proto macp/v1/core.proto macp/modes/decision/v1/decision.proto macp/modes/proposal/v1/proposal.proto macp/modes/task/v1/task.proto macp/modes/handoff/v1/handoff.proto macp/modes/quorum/v1/quorum.proto
## First-time setup: configure git hooks
setup:
git config core.hooksPath .githooks
@echo "Git hooks configured."
build:
cargo build
test:
cargo test
fmt:
cargo fmt --all
clippy:
cargo clippy --all-targets -- -D warnings
check: fmt clippy test
## Pull latest proto files from BSR
sync-protos:
buf export buf.build/multiagentcoordinationprotocol/macp -o proto
@echo "Done. Run 'git diff proto/' to review changes."
## Sync from local sibling checkout (for development before BSR publish)
sync-protos-local:
@if [ ! -d "$(SPEC_PROTO_DIR)" ]; then \
echo "Error: Spec repo not found at $(SPEC_PROTO_DIR)"; \
echo "Use 'make sync-protos' to sync from BSR instead."; \
exit 1; \
fi
@for f in $(PROTO_FILES); do \
mkdir -p proto/$$(dirname $$f); \
cp "$(SPEC_PROTO_DIR)/$$f" "proto/$$f"; \
echo " Copied $$f"; \
done
@echo "Done. Run 'git diff proto/' to review changes."
## Check if local protos match BSR
check-protos:
@TMPDIR=$$(mktemp -d); \
buf export buf.build/multiagentcoordinationprotocol/macp -o "$$TMPDIR"; \
DRIFT=0; \
for f in $(PROTO_FILES); do \
if ! diff -q "$$TMPDIR/$$f" "proto/$$f" > /dev/null 2>&1; then \
echo "DRIFT: $$f"; \
DRIFT=1; \
fi; \
done; \
rm -rf "$$TMPDIR"; \
if [ "$$DRIFT" -eq 0 ]; then \
echo "All proto files match BSR."; \
else \
echo "Run 'make sync-protos' to update."; \
exit 1; \
fi