.PHONY: all build check test test-verbose nextest nextest-ci nextest-quick clippy fmt clean doc run-basic run-cluster help
all: check clippy test
build:
cargo build
release:
cargo build --release
check:
cargo check
test:
cargo test
test-verbose:
cargo test -- --nocapture
test-one:
@test -n "$(TEST)" || (echo "Usage: make test-one TEST=<test_name>" && exit 1)
cargo test $(TEST)
nextest:
cargo nextest run --features full,dashboard
nextest-ci:
cargo nextest run --features full,dashboard --profile ci
nextest-quick:
cargo nextest run --features full,dashboard --profile quick
nextest-filter:
@test -n "$(FILTER)" || (echo "Usage: make nextest-filter FILTER=<pattern>" && exit 1)
cargo nextest run --features full,dashboard -E 'test($(FILTER))'
clippy:
cargo clippy
clippy-strict:
cargo clippy -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
doc:
cargo doc --no-deps
doc-open:
cargo doc --no-deps --open
clean:
cargo clean
run-basic:
cargo run --example basic
run-cluster:
@test -n "$(NODE)" || (echo "Usage: make run-cluster NODE=<node_id>" && exit 1)
RUST_LOG=info cargo run --example cluster -- $(NODE)
run-memberlist:
@test -n "$(NODE)" || (echo "Usage: make run-memberlist NODE=<node_id>" && exit 1)
RUST_LOG=info cargo run --example memberlist-cluster -- $(NODE)
run-discovery:
cargo run --example auto-discovery
ci: fmt-check clippy-strict test
watch:
cargo watch -x test
help:
@echo "Crema - Distributed Cache Makefile"
@echo ""
@echo "Usage: make [target]"
@echo ""
@echo "Build targets:"
@echo " build Build the project (debug)"
@echo " release Build the project (release)"
@echo " check Check code without building"
@echo " clean Clean build artifacts"
@echo ""
@echo "Test targets:"
@echo " nextest Run tests with nextest (recommended)"
@echo " nextest-ci Run nextest with CI profile (more retries)"
@echo " nextest-quick Run nextest quick (fail-fast)"
@echo " nextest-filter Run nextest with filter (FILTER=<pattern>)"
@echo " test Run all tests (legacy cargo test)"
@echo " test-verbose Run tests with output"
@echo " test-one Run a specific test (TEST=<name>)"
@echo ""
@echo "Code quality:"
@echo " clippy Run clippy lints"
@echo " clippy-strict Run clippy with warnings as errors"
@echo " fmt Format code"
@echo " fmt-check Check formatting"
@echo " ci Run all CI checks"
@echo ""
@echo "Documentation:"
@echo " doc Generate documentation"
@echo " doc-open Generate and open documentation"
@echo ""
@echo "Examples:"
@echo " run-basic Run basic example"
@echo " run-cluster Run cluster node (NODE=1|2|3)"
@echo " run-memberlist Run memberlist cluster (NODE=1|2|3)"
@echo " run-discovery Run auto-discovery example"
@echo ""
@echo "Other:"
@echo " watch Watch for changes and run tests"
@echo " help Show this help message"