.PHONY: help build test test-unit test-integration test-all clean lint fmt check docs examples docker-up docker-down setup
help:
@echo "RustRabbit - Development Commands"
@echo "================================="
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
build:
cargo build
build-release:
cargo build --release
test: test-unit
test-unit:
cargo test --lib
test-integration:
./scripts/run-integration-tests.sh
test-integration-keep:
./scripts/run-integration-tests.sh --keep-running
test-all: test-unit test-integration
check:
cargo check
cargo check --examples
cargo check --tests
lint:
cargo clippy -- -D warnings
cargo clippy --examples -- -D warnings
cargo clippy --tests -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
docs:
cargo doc --no-deps --open
docs-private:
cargo doc --no-deps --document-private-items --open
examples:
@echo "Running Publisher Example..."
cargo run --example publisher_example
@echo "Running Consumer Example..."
cargo run --example consumer_example
@echo "Running Retry Example..."
cargo run --example retry_example
@echo "Running Health Monitoring Example..."
cargo run --example health_monitoring_example
@echo "Running Builder Pattern Example..."
cargo run --example builder_pattern_example
example-publisher:
cargo run --example publisher_example
example-consumer:
cargo run --example consumer_example
example-retry:
cargo run --example retry_example
example-health:
cargo run --example health_monitoring_example
example-builder:
cargo run --example builder_pattern_example
docker-up:
docker-compose -f docker-compose.test.yml up -d
@echo "Waiting for RabbitMQ to be ready..."
@timeout 60 bash -c 'until docker-compose -f docker-compose.test.yml exec -T rabbitmq rabbitmq-diagnostics ping >/dev/null 2>&1; do sleep 2; done'
@echo "RabbitMQ is ready!"
@echo "Management UI: http://localhost:15672 (admin/password)"
@echo "AMQP Port: localhost:5672"
docker-down:
docker-compose -f docker-compose.test.yml down
docker-logs:
docker-compose -f docker-compose.test.yml logs -f
docker-clean:
docker-compose -f docker-compose.test.yml down -v
docker system prune -f
setup:
@echo "Setting up RustRabbit development environment..."
rustup component add clippy rustfmt
cargo install cargo-watch
chmod +x scripts/*.sh
@echo "Development environment setup complete!"
install-deps:
@echo "Installing development dependencies..."
@if command -v docker >/dev/null 2>&1; then \
echo "✓ Docker is installed"; \
else \
echo "✗ Docker is not installed. Please install Docker first."; \
exit 1; \
fi
@if command -v docker-compose >/dev/null 2>&1; then \
echo "✓ Docker Compose is installed"; \
else \
echo "✗ Docker Compose is not installed. Please install Docker Compose first."; \
exit 1; \
fi
dev:
cargo watch -x check -x test
dev-integration: docker-up
cargo watch -x "test --test integration_example -- --test-threads=1"
bench:
cargo bench
bench-integration:
cargo test --test integration_example test_performance_benchmark -- --nocapture
clean:
cargo clean
clean-all: clean docker-clean
pre-release: fmt lint test-all docs
@echo "Pre-release checks completed successfully!"
version-patch:
cargo set-version --bump patch
version-minor:
cargo set-version --bump minor
version-major:
cargo set-version --bump major
ci:
@echo "Running CI pipeline simulation..."
make fmt-check
make lint
make check
make test-unit
make test-integration
make docs
@echo "CI pipeline simulation completed successfully!"
rabbitmq-status:
@if docker-compose -f docker-compose.test.yml ps | grep -q "Up"; then \
echo "RabbitMQ containers are running:"; \
docker-compose -f docker-compose.test.yml ps; \
echo "Management UI: http://localhost:15672 (admin/password)"; \
else \
echo "RabbitMQ containers are not running. Use 'make docker-up' to start them."; \
fi
stats:
@echo "RustRabbit Project Statistics"
@echo "============================="
@echo "Lines of code:"
@find src -name "*.rs" -exec wc -l {} + | tail -1
@echo "Test files:"
@find tests -name "*.rs" | wc -l
@echo "Example files:"
@find examples -name "*.rs" | wc -l
@echo "Dependencies:"
@cargo tree --depth 1 | grep -v "└─" | grep -v "├─" | wc -l
quick-test:
cargo test --lib --quiet
quick-check:
cargo check --quiet
rebuild: clean build
.DEFAULT_GOAL := help