-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
166 lines (121 loc) · 4.78 KB
/
Makefile
File metadata and controls
166 lines (121 loc) · 4.78 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# AIngle Development Makefile
# Version: 2.0.0
.PHONY: all setup build build-release test test-all clean lint fmt check docs run run-iot help
# Default target
all: help
# ============================================================================
# Setup
# ============================================================================
setup: ## Full development environment setup
@./scripts/setup.sh --full
setup-deps: ## Install dependencies only
@./scripts/setup.sh --deps-only
setup-iot: ## Setup IoT mode configuration
@./scripts/setup.sh --iot
# ============================================================================
# Build
# ============================================================================
build: ## Build in debug mode
cargo build
build-release: ## Build in release mode (optimized)
cargo build --release
build-adk: ## Build ADK only
cargo build -p adk
build-minimal: ## Build minimal IoT node
cargo build --release --features minimal -p aingle
# ============================================================================
# Testing
# ============================================================================
test: ## Run unit tests
cargo test --workspace --lib
test-all: ## Run all tests including integration
cargo test --workspace
test-adk: ## Run ADK tests
cargo test -p adk
test-p2p: ## Run P2P networking tests
cargo test -p kitsune_p2p
# ============================================================================
# Code Quality
# ============================================================================
lint: ## Run clippy linter
cargo clippy --workspace --all-targets -- -D warnings
fmt: ## Format code
cargo fmt --all
fmt-check: ## Check formatting without changes
cargo fmt --all -- --check
check: ## Run cargo check
cargo check --workspace
audit: ## Security audit dependencies
cargo audit
# ============================================================================
# Documentation
# ============================================================================
docs: ## Generate documentation
cargo doc --workspace --no-deps
docs-open: ## Generate and open documentation
cargo doc --workspace --no-deps --open
# ============================================================================
# Running
# ============================================================================
run: ## Run AIngle node (default mode)
cargo run --bin aingle
run-iot: ## Run AIngle node in IoT mode (sub-second confirmation)
AINGLE_PUBLISH_INTERVAL_MS=0 \
AINGLE_GOSSIP_LOOP_ITERATION_DELAY_MS=100 \
cargo run --bin aingle
run-minimal: ## Run minimal IoT node
cargo build --release -p aingle_minimal && \
AINGLE_IOT_MODE=1 ./target/release/aingle-minimal
run-sandbox: ## Run AI sandbox
cargo run --bin ai_sandbox
# ============================================================================
# Cleaning
# ============================================================================
clean: ## Clean build artifacts
cargo clean
clean-all: ## Clean everything including data
cargo clean
rm -rf data/
rm -f .env.local .env.iot
# ============================================================================
# Development Utilities
# ============================================================================
watch: ## Watch for changes and rebuild
cargo watch -x build
watch-test: ## Watch for changes and run tests
cargo watch -x 'test --workspace --lib'
bench: ## Run benchmarks
cargo bench --workspace
# ============================================================================
# WASM
# ============================================================================
wasm-build: ## Build WASM targets
cargo build --target wasm32-unknown-unknown -p adk
wasm-check: ## Check WASM targets compile
cargo check --target wasm32-unknown-unknown -p adk
# ============================================================================
# CI/CD
# ============================================================================
ci: fmt-check lint test ## Run CI checks locally
@echo "All CI checks passed!"
ci-full: fmt-check lint test-all audit ## Run full CI checks
@echo "All full CI checks passed!"
# ============================================================================
# Help
# ============================================================================
help: ## Show this help message
@echo ""
@echo "AIngle Development Commands"
@echo "=========================="
@echo ""
@echo "Usage: make [target]"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
@echo ""
@echo "Examples:"
@echo " make setup # Full development setup"
@echo " make build # Build in debug mode"
@echo " make test # Run tests"
@echo " make run-iot # Run in IoT mode"
@echo ""