-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
79 lines (64 loc) · 1.7 KB
/
Makefile
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
export
RUST_BACKTRACE=full
.PHONY: ci
ci: # Checks same as CI
@make test-ci; \
make check; \
make fmt; \
make spell-check
.PHONY: tools
tools: tool-test tool-bump-version tool-spell-check
.PHONY: tool-test
tool-test:
@if ! which cargo-nextest > /dev/null; then \
cargo install cargo-nextest; \
fi
.PHONY: tool-bump-version
tool-bump-version:
@if ! which cargo-set-version > /dev/null; then \
cargo install cargo-edit; \
fi
.PHONY: tool-spell-check
tool-spell-check:
@if ! which typos > /dev/null; then \
cargo install typos-cli; \
fi
.PHONY: test-ci # for CI
test-ci:
RUST_BACKTRACE=full FZF_MAKE_IS_TESTING=true cargo test
.PHONY: test
test: tool-test
rm -rf ./test_dir
RUST_BACKTRACE=full FZF_MAKE_IS_TESTING=true cargo nextest run
.PHONY: test-watch
test-watch: tool-test
rm -rf ./test_dir
RUST_BACKTRACE=full FZF_MAKE_IS_TESTING=true cargo watch -x "nextest run"
.PHONY: bump-fzf-make-version
bump-fzf-make-version: tool-bump-version
@git checkout main; \
git pull; \
cargo set-version --bump minor; \
export CURRENT_VERSION=$$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version'); \
git add .; \
git commit -m "Bump fzf-make's version to v$${CURRENT_VERSION}"; \
git push origin HEAD; \
gh release create "v$${CURRENT_VERSION}" --generate-notes --draft | sed 's@releases/tag@releases/edit@' | xargs open
.PHONY: spell-check
spell-check: tool-spell-check
typos
.PHONY: run
run:
@cargo build && mv ./target/debug/fzf-make ./test_data && cd ./test_data && ./fzf-make
.PHONY: build
build:
@cargo build
.PHONY: fmt
fmt:
@cargo fmt -- --check
.PHONY: check
check:
@cargo clippy -- -D warnings
.PHONY: build-release
build-release:
@cargo build --verbose --release