forked from rtk-ai/rtk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (47 loc) · 1.57 KB
/
Makefile
File metadata and controls
61 lines (47 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.PHONY: build release test check lint fmt fmt-check install clean cover release-patch release-minor release-major
build:
cargo build
release:
cargo build --release
test:
cargo test --all
check: fmt-check lint test
lint:
cargo clippy --all-targets -- -D warnings
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check
install:
cargo install --path .
clean:
cargo clean
cover:
cargo llvm-cov --html --output-dir target/coverage/html
@echo "Coverage report: target/coverage/html/index.html"
cover-open: cover
open target/coverage/html/index.html
release-patch:
@VERSION=$$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/'); \
MAJOR=$$(echo $$VERSION | cut -d. -f1); \
MINOR=$$(echo $$VERSION | cut -d. -f2); \
PATCH=$$(echo $$VERSION | cut -d. -f3); \
NEW="$$MAJOR.$$MINOR.$$((PATCH + 1))"; \
sed -i '' "s/^version = \"$$VERSION\"/version = \"$$NEW\"/" Cargo.toml; \
echo "$$VERSION → $$NEW"; \
cargo build --release
release-minor:
@VERSION=$$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/'); \
MAJOR=$$(echo $$VERSION | cut -d. -f1); \
MINOR=$$(echo $$VERSION | cut -d. -f2); \
NEW="$$MAJOR.$$((MINOR + 1)).0"; \
sed -i '' "s/^version = \"$$VERSION\"/version = \"$$NEW\"/" Cargo.toml; \
echo "$$VERSION → $$NEW"; \
cargo build --release
release-major:
@VERSION=$$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/'); \
MAJOR=$$(echo $$VERSION | cut -d. -f1); \
NEW="$$((MAJOR + 1)).0.0"; \
sed -i '' "s/^version = \"$$VERSION\"/version = \"$$NEW\"/" Cargo.toml; \
echo "$$VERSION → $$NEW"; \
cargo build --release