-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (65 loc) · 3.5 KB
/
Copy pathMakefile
File metadata and controls
84 lines (65 loc) · 3.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
# Trellis Protocol — Build Automation
#
# Available targets:
# make help — list all targets
# make build — build everything (contract WASM + frontend)
# make test — run all tests (contract + frontend)
# make lint — run all linters (clippy + oxlint)
# make deploy — deploy contract to testnet (see DEPLOYMENT.md)
# make clean — remove all build artifacts
# make build-contract — build only the contract WASM
# make build-cli — build only the CLI binary
# make build-frontend — build only the frontend bundle
# make test-contract — run only contract tests
# make test-frontend — run only frontend tests
# make lint-contract — run only clippy on contract and CLI
# make lint-frontend — run only oxlint on frontend
.PHONY: help build test lint deploy clean
.PHONY: build-contract build-cli build-frontend
.PHONY: test-contract test-frontend
.PHONY: lint-contract lint-frontend
help:
@echo "Trellis Protocol — Build Targets"
@echo ""
@grep -E '^[a-z-]+:' $(MAKEFILE_LIST) | sort | while IFS=: read -r target _; do \
desc=$$(grep -A1 "^$$target:" $(MAKEFILE_LIST) | tail -1 | sed 's/# //'); \
printf " %-20s %s\n" "$$target" "$$desc"; \
done
# ── Build ──────────────────────────────────────────────────────────────────
build: build-contract build-cli build-frontend
build-contract:
cargo build --manifest-path contracts/trellis_core/Cargo.toml --target wasm32-unknown-unknown --release
build-cli:
cargo build --manifest-path cli/trellis_cli/Cargo.toml --release
build-frontend:
cd frontend && npm install && npm run build
# ── Test ───────────────────────────────────────────────────────────────────
test: test-contract test-frontend
test-contract:
cargo test --manifest-path contracts/trellis_core/Cargo.toml
test-frontend:
cd frontend && npm install && npm test
# ── Lint ───────────────────────────────────────────────────────────────────
lint: lint-contract lint-frontend
lint-contract:
cargo clippy --manifest-path contracts/trellis_core/Cargo.toml -- -D warnings
cargo clippy --manifest-path cli/trellis_cli/Cargo.toml -- -D warnings
lint-frontend:
cd frontend && npm install && npm run lint
# ── Deploy ─────────────────────────────────────────────────────────────────
deploy:
@echo "=== Deploying Trellis to Stellar Testnet ==="
@echo "Ensure you have:"
@echo " 1. A funded testnet identity: stellar keys fund <name> --network testnet"
@echo " 2. The contract WASM built: make build-contract"
@echo ""
@echo "Running: stellar contract deploy ..."
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/trellis_core.wasm \
--source trellis-deployer \
--network testnet
# ── Clean ──────────────────────────────────────────────────────────────────
clean:
cargo clean
cd frontend && rm -rf dist node_modules
rm -rf target