forked from OpenLedger-Foundation/Kora-Contract
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (51 loc) · 2.66 KB
/
Makefile
File metadata and controls
71 lines (51 loc) · 2.66 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
# =============================================================================
# Kora Protocol — Makefile
# =============================================================================
.PHONY: build test clean fmt lint check deploy-testnet deploy-mainnet
WASM_TARGET := wasm32-unknown-unknown
CONTRACTS := access_control invoice_nft marketplace financing_pool treasury risk_registry
# ── Build ─────────────────────────────────────────────────────────────────────
build:
cargo build --target $(WASM_TARGET) --release
build-optimized: build
@for c in $(CONTRACTS); do \
wasm="target/$(WASM_TARGET)/release/kora_$${c}.wasm"; \
if [ -f "$$wasm" ]; then \
stellar contract optimize --wasm "$$wasm"; \
echo "Optimized: $$wasm"; \
fi; \
done
# ── Test ──────────────────────────────────────────────────────────────────────
test:
cargo test --all
test-verbose:
cargo test --all -- --nocapture
# ── Code Quality ──────────────────────────────────────────────────────────────
fmt:
cargo fmt --all
lint:
cargo clippy --all -- -D warnings
check:
cargo check --all
# ── Clean ─────────────────────────────────────────────────────────────────────
clean:
cargo clean
# ── Deploy ────────────────────────────────────────────────────────────────────
deploy-testnet: build-optimized
bash scripts/deploy.sh testnet
deploy-mainnet: build-optimized
@echo "WARNING: Deploying to MAINNET. Press Ctrl+C to abort, Enter to continue."
@read _
bash scripts/deploy.sh mainnet
# ── Helpers ───────────────────────────────────────────────────────────────────
setup:
rustup target add $(WASM_TARGET)
cargo install stellar-cli --locked
sizes: build
@echo "WASM sizes:"
@for c in $(CONTRACTS); do \
wasm="target/$(WASM_TARGET)/release/kora_$${c}.wasm"; \
if [ -f "$$wasm" ]; then \
printf " %-25s %s\n" "$$c" "$$(du -sh $$wasm | cut -f1)"; \
fi; \
done