-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (63 loc) · 2.22 KB
/
Makefile
File metadata and controls
72 lines (63 loc) · 2.22 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
.PHONY: help build test fmt lint wasm clean check-deps install-deps
# Default target
help:
@echo "SkillSync Soroban Development Commands:"
@echo ""
@echo " install-deps Install all required dependencies"
@echo " check-deps Verify dependencies are installed"
@echo " build Build all workspace members"
@echo " wasm Build contract for WASM target"
@echo " test Run all tests"
@echo " fmt Format code with rustfmt"
@echo " lint Run clippy lints"
@echo " clean Clean build artifacts"
@echo " help Show this help message"
# Install dependencies
install-deps:
@echo "Installing Rust toolchain..."
rustup toolchain install stable
rustup target add wasm32-unknown-unknown
rustup component add rustfmt clippy
@echo "Installing Soroban CLI..."
cargo install soroban-cli
@echo "Dependencies installed successfully!"
# Check if dependencies are installed
check-deps:
@echo "Checking Rust toolchain..."
@rustup --version || (echo "❌ Rust not installed. Run 'make install-deps'" && exit 1)
@echo "Checking WASM target..."
@rustup target list --installed | grep wasm32-unknown-unknown || (echo "❌ WASM target not installed. Run 'make install-deps'" && exit 1)
@echo "Checking Soroban CLI..."
@soroban --version || (echo "❌ Soroban CLI not installed. Run 'make install-deps'" && exit 1)
@echo "✅ All dependencies are installed!"
# Build all workspace members
build:
@echo "Building workspace..."
cargo build --release
@echo "✅ Build completed!"
# Build contract for WASM target
wasm:
@echo "Building contract for WASM..."
cargo build -p skillsync-core --target wasm32-unknown-unknown --release
@echo "✅ WASM build completed!"
@echo "📦 Artifact: target/wasm32-unknown-unknown/release/skillsync_core.wasm"
# Run tests
test:
@echo "Running tests..."
cargo test --release
@echo "✅ Tests completed!"
# Format code
fmt:
@echo "Formatting code..."
cargo fmt --all
@echo "✅ Code formatted!"
# Run lints
lint:
@echo "Running clippy lints..."
cargo clippy --all-targets --all-features -- -D warnings
@echo "✅ Linting completed!"
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
cargo clean
@echo "✅ Clean completed!"