.PHONY: help build run test clean install fmt lint audit sbom sbom-check
help:
@echo "MicroRapid Development Commands"
@echo "==============================="
@echo "make build - Build debug version"
@echo "make release - Build release version"
@echo "make run - Run with example"
@echo "make test - Run all tests"
@echo "make clean - Clean build artifacts"
@echo "make install - Install locally"
@echo "make fmt - Format code"
@echo "make lint - Run clippy linter"
@echo "make audit - Security audit"
@echo "make sbom - Generate Software Bill of Materials"
@echo "make sbom-check - Generate SBOM and check vulnerabilities"
@echo "make all - Format, lint, test, and build"
build:
cargo build
release:
cargo build --release
run:
cargo run -- run examples/petstore.yaml --operation getPetById
init:
cargo run -- init test-project
test:
cargo test
test-verbose:
cargo test -- --nocapture
clean:
cargo clean
rm -rf test-* tmp/
install:
cargo install --path .
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
lint:
cargo clippy -- -D warnings
lint-fix:
cargo clippy --fix --allow-dirty
audit:
cargo audit
deny:
cargo deny check
ci: fmt-check lint test build
all: fmt lint test release
watch:
cargo watch -x build
watch-test:
cargo watch -x test
watch-run:
cargo watch -x "run -- run examples/petstore.yaml --operation getPetById"
demo:
@echo "Testing init command..."
cargo run -- init demo-project --force
@echo "\nTesting run command..."
cargo run -- run examples/jsonplaceholder.yaml --operation getUsers
@echo "\nTesting test command..."
cargo run -- test examples/petstore.yaml --operation getPetById
@echo "\nCleaning up..."
rm -rf demo-project
size: release
@ls -lh target/release/mrapids | awk '{print "Release binary size: " $$5}'
bench:
cargo bench
docs:
cargo doc --open
update:
cargo update
outdated:
cargo outdated
sbom:
@echo "Generating Software Bill of Materials..."
@./scripts/generate-sbom.sh
sbom-check: sbom
@echo "Checking for vulnerabilities in SBOMs..."
@if command -v grype >/dev/null 2>&1; then \
echo "Running Grype vulnerability scan..."; \
grype sbom:sbom/mrapids-sbom-spdx.json --quiet || true; \
grype sbom:sbom/mrapids-agent-sbom-spdx.json --quiet || true; \
else \
echo "Grype not installed. Install with: brew install grype"; \
fi
install-sbom-tools:
@echo "Installing SBOM generation tools..."
cargo install cargo-sbom
@echo "Installing vulnerability scanner..."
@if [[ "$$(uname)" == "Darwin" ]]; then \
brew install grype; \
else \
echo "Please install grype from https://github.com/anchore/grype"; \
fi