forked from epwalsh/rust-cached-path
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (59 loc) · 1.2 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
.PHONY : setup
setup :
rustup component add rustfmt
rustup component add clippy
#
# Cargo helpers.
#
.PHONY : build
build :
cargo build
.PHONY : release
release :
cargo build --release
.PHONY : format
format :
cargo fmt --
.PHONY : lint
lint :
cargo fmt -- --check
cargo clippy --all-targets --all-features -- -D warnings
.PHONY : test
test :
cargo test
.PHONY : doc
doc :
cargo doc
.PHONY : all-checks
all-checks : lint test doc
.PHONY : publish
publish :
cargo publish
.PHONY : readme
readme :
cargo readme > README.md
#
# Git helpers.
#
.PHONY: create-branch
create-branch :
ifneq ($(issue),)
git checkout -b ISSUE-$(issue)
git push --set-upstream origin $$(git branch | grep \* | cut -d ' ' -f2)
else ifneq ($(name),)
git checkout -b $(name)
git push --set-upstream origin $$(git branch | grep \* | cut -d ' ' -f2)
else
$(error must supply 'issue' or 'name' parameter)
endif
.PHONY : delete-branch
delete-branch :
@BRANCH=`git rev-parse --abbrev-ref HEAD` \
&& [ $$BRANCH != 'master' ] \
&& echo "On branch $$BRANCH" \
&& echo "Checking out master" \
&& git checkout master \
&& git pull \
&& echo "Deleting branch $$BRANCH" \
&& git branch -d $$BRANCH \
&& git remote prune origin