Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (79 loc) · 3.31 KB
/
Copy pathMakefile
File metadata and controls
94 lines (79 loc) · 3.31 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
.DEFAULT_GOAL := help
SHELL := /bin/bash
MAKEFLAGS += --silent
.PHONY: help build build-minting test test-minting deploy-testnet deploy-mainnet \
update-registry setup-hooks validate-snapshots clean-snapshots \
docs-error-codes check-error-codes
help:
@printf "Usage:\n"
@printf " make build Build all contracts\n"
@printf " make test Run all workspace tests\n"
@printf " make deploy-testnet Deploy all 8 contracts to Stellar testnet\n"
@printf " make deploy-mainnet Deploy all 8 contracts to Stellar mainnet\n"
@printf " (requires DEPLOY_CONFIRM=deploy)\n"
@printf " make update-registry Rebuild deployments/registry.json from per-network snapshots\n"
@printf " make setup-hooks Install git hooks for the repository\n"
@printf " make build-minting Build the acbu_minting contract\n"
@printf " make test-minting Run tests for the acbu_minting contract\n"
@printf " make validate-snapshots Validate test snapshots for staleness\n"
@printf " make clean-snapshots Delete all test snapshots (use before regeneration)\n"
@printf " make docs-error-codes Regenerate docs/ERROR_CODES.md from source\n"
@printf " make check-error-codes Verify docs/ERROR_CODES.md matches source\n"
build:
@printf "Building all contracts...\n"
cargo build --target wasm32-unknown-unknown --release
build-minting:
@printf "Building acbu_minting contract...\n"
cd acbu_minting && cargo build --target wasm32-unknown-unknown --release
test:
@printf "Running workspace tests...\n"
cargo test
test-minting:
@printf "Running acbu_minting tests...\n"
cd acbu_minting && cargo test
deploy-testnet:
@if [ -z "$$STELLAR_SECRET_KEY" ]; then \
echo "ERROR: STELLAR_SECRET_KEY must be set for deployment."; \
echo " export STELLAR_SECRET_KEY=\"<your-testnet-secret-key>\""; \
exit 1; \
fi
@printf "Deploying all 8 contracts to testnet...\n"
bash scripts/deploy.sh testnet
deploy-mainnet:
@if [ -z "$$STELLAR_SECRET_KEY" ]; then \
echo "ERROR: STELLAR_SECRET_KEY must be set for deployment."; \
echo " export STELLAR_SECRET_KEY=\"<your-mainnet-secret-key>\""; \
exit 1; \
fi
@if [ "$$DEPLOY_CONFIRM" != "deploy" ]; then \
echo "ERROR: Mainnet deploy requires DEPLOY_CONFIRM=deploy."; \
echo " export DEPLOY_CONFIRM=deploy"; \
exit 1; \
fi
@printf "Deploying all 8 contracts to mainnet...\n"
bash scripts/deploy.sh mainnet
update-registry:
@printf "Rebuilding deployments/registry.json from per-network snapshots...\n"
@for net in testnet mainnet; do \
file="deployments/$${net}.json"; \
if [ -f "$$file" ]; then \
bash scripts/update_registry.sh "$$net" "$$file"; \
fi; \
done
@printf "Registry updated.\n"
setup-hooks:
@printf "Setting up git hooks...\n"
bash scripts/setup-git-hooks.sh
validate-snapshots:
@printf "Validating test snapshots...\n"
cargo test test_snapshot_validation --package acbu_minting -- --nocapture
clean-snapshots:
@printf "Cleaning test snapshots...\n"
rm -rf acbu_minting/test_snapshots/*.json
@printf "Snapshots cleaned. Regenerate by running: make test-minting\n"
docs-error-codes:
@printf "Regenerating docs/ERROR_CODES.md...\n"
python scripts/generate_error_codes.py
check-error-codes:
@printf "Checking docs/ERROR_CODES.md against source...\n"
python scripts/generate_error_codes.py --check