.PHONY: all build build-release check test test-verbose lint fmt clean install uninstall cov cov-html cov-open doc doc-open help
.PHONY: release-patch release-minor release-major release-dry
all: check test
build:
cargo build
build-release:
cargo build --release
check:
cargo check
test:
cargo test
test-verbose:
cargo test -- --nocapture
test-one:
cargo test $(TEST) -- --nocapture
test-serial:
cargo test -- --test-threads=1
lint:
cargo clippy -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
ci: fmt-check lint test
cov-install:
cargo install cargo-llvm-cov
cov:
cargo llvm-cov --all-features
cov-html:
cargo llvm-cov --all-features --html
cov-open:
cargo llvm-cov --all-features --open
cov-lcov:
cargo llvm-cov --all-features --lcov --output-path lcov.info
doc:
cargo doc --no-deps
doc-open:
cargo doc --no-deps --open
install:
cargo install --path .
uninstall:
cargo uninstall shnote
clean:
cargo clean
clean-cov:
cargo llvm-cov clean --workspace
release-dry:
cargo release patch --no-publish --no-verify
release-patch:
cargo release patch --execute --no-publish --no-verify
release-minor:
cargo release minor --execute --no-publish --no-verify
release-major:
cargo release major --execute --no-publish --no-verify
publish-check:
cargo publish --dry-run
help:
@echo "shnote 开发命令"
@echo ""
@echo "构建:"
@echo " make build - Debug 构建"
@echo " make build-release - Release 构建"
@echo " make check - 检查编译"
@echo ""
@echo "测试:"
@echo " make test - 运行所有测试"
@echo " make test-verbose - 详细输出测试"
@echo " make test-one TEST=name - 运行特定测试"
@echo " make test-serial - 串行运行测试"
@echo ""
@echo "代码质量:"
@echo " make lint - Clippy 检查"
@echo " make fmt - 格式化代码"
@echo " make fmt-check - 检查格式"
@echo " make ci - 完整 CI 检查"
@echo ""
@echo "覆盖率:"
@echo " make cov-install - 安装覆盖率工具"
@echo " make cov - 终端覆盖率报告"
@echo " make cov-html - HTML 覆盖率报告"
@echo " make cov-open - 生成并打开 HTML 报告"
@echo ""
@echo "文档:"
@echo " make doc - 生成文档"
@echo " make doc-open - 生成并打开文档"
@echo ""
@echo "发布:"
@echo " make release-dry - 预览发布(dry-run)"
@echo " make release-patch - 发布 patch 版本"
@echo " make release-minor - 发布 minor 版本"
@echo " make release-major - 发布 major 版本"
@echo ""
@echo "其他:"
@echo " make install - 安装到系统"
@echo " make uninstall - 从系统卸载"
@echo " make clean - 清理构建产物"