.PHONY: help setup check quick-check format lint test test-all examples docs clean audit coverage bench
help:
@echo "MCP Protocol SDK - Development Commands"
@echo "==================================="
@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 @echo " make check @echo " make quick @echo " make test
setup:
@echo "๐ง Setting up development environment..."
./scripts/setup-dev.sh
check:
@echo "๐ Running full CI checks..."
./scripts/ci-check.sh
quick-check:
@echo "โก Running quick checks..."
./scripts/ci-check.sh --quick
format:
@echo "๐จ Formatting code..."
cargo fmt --all
format-check:
@echo "๐ Checking code formatting..."
cargo fmt --all -- --check
lint:
@echo "๐งน Running clippy lints..."
cargo clippy --all-features -- -W clippy::all -A unused_imports -A unused_variables -A dead_code -A unused_mut -A private_interfaces -A clippy::redundant_closure -A clippy::redundant_pattern_matching -A clippy::should_implement_trait -A clippy::manual_strip -A clippy::type_complexity
lint-fix:
@echo "๐ง Fixing clippy issues..."
cargo clippy --all-features --fix
compile:
@echo "๐จ Checking compilation..."
cargo check --all-features
test:
@echo "๐งช Running tests..."
cargo test --verbose
test-all:
@echo "๐งช Running all tests..."
cargo test --all-features --verbose
cargo test --no-default-features --verbose
cargo test --features stdio --verbose
cargo test --features http --verbose
cargo test --features websocket --verbose
cargo test --features validation --verbose
examples:
@echo "๐ Checking examples..."
cargo check --example simple_server
cargo check --example echo_server
cargo check --example client_example
cargo check --example database_server
cargo check --example http_server --features http
cargo check --example http_client --features http
cargo check --example websocket_server --features websocket
cargo check --example websocket_client --features websocket
docs:
@echo "๐ Building documentation..."
cargo doc --all-features --no-deps --document-private-items
docs-open:
@echo "๐ Building and opening documentation..."
cargo doc --all-features --no-deps --document-private-items --open
clean:
@echo "๐งฝ Cleaning build artifacts..."
cargo clean
audit:
@echo "๐ Running security audit..."
cargo audit
coverage:
@echo "๐ Generating code coverage..."
cargo tarpaulin --all-features --workspace --timeout 120 --out html
@echo "Coverage report generated: tarpaulin-report.html"
bench:
@echo "๐๏ธ Running benchmarks..."
cargo bench
dev-setup: setup
@echo "โ
Development environment ready!"
pre-commit: format lint compile test examples
@echo "โ
Pre-commit checks passed!"
ci-local: check
@echo "โ
Local CI checks complete!"
pre-release: test-all docs audit
@echo "๐ Ready for release!"
test-stdio:
cargo test --features stdio --verbose
test-http:
cargo test --features http --verbose
test-websocket:
cargo test --features websocket --verbose
test-validation:
cargo test --features validation --verbose
watch:
@echo "๐ Watching for changes..."
cargo watch -x "test --all-features"
watch-check:
@echo "๐ Watching for changes (checks only)..."
cargo watch -x "check --all-features"
deps:
cargo tree --all-features
outdated:
cargo outdated
update:
cargo update
docker-build:
@echo "๐ณ Building Docker image..."
docker build -t mcp-protocol-sdk .
docker-test:
@echo "๐ณ Running tests in Docker..."
docker run --rm mcp-protocol-sdk cargo test --all-features
install-hooks:
@echo "๐ช Installing git hooks..."
cp .git/hooks/pre-commit.sample .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
bloat:
@echo "๐ Analyzing binary size..."
cargo bloat --release --crates
check-cross:
@echo "๐ Checking cross-compilation..."
cargo check --target x86_64-unknown-linux-gnu
cargo check --target x86_64-pc-windows-gnu
cargo check --target x86_64-apple-darwin