-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (59 loc) · 2.44 KB
/
Copy pathMakefile
File metadata and controls
73 lines (59 loc) · 2.44 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
.DEFAULT_GOAL := help
SHELL := /bin/bash
MAKEFLAGS += --silent
.PHONY: help build build-minting test test-minting deploy-testnet deploy-mainnet 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 to Stellar testnet\n"
@printf " make deploy-mainnet Deploy to Stellar mainnet\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."; \
exit 1; \
fi
@printf "Deploying to testnet...\n"
./scripts/deploy_testnet.sh
deploy-mainnet:
@if [ -z "$$STELLAR_SECRET_KEY" ]; then \
echo "ERROR: STELLAR_SECRET_KEY must be set for deployment."; \
exit 1; \
fi
@printf "Deploying to mainnet...\n"
./scripts/deploy_mainnet.sh
setup-hooks:
@printf "Setting up git hooks...\n"
./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