forked from git-bug/git-bug
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.47 KB
/
Copy pathMakefile
File metadata and controls
58 lines (46 loc) · 1.47 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
UNAME_S := $(shell uname -s)
XARGS:=xargs -r
ifeq ($(UNAME_S),Darwin)
XARGS:=xargs
endif
TAG:=$(shell git describe --match 'v*' --always --dirty --broken)
LDFLAGS:=-X main.version="${TAG}"
all: build
.PHONY: build-webui
build-webui:
cd webui && pnpm install && pnpm run build
.PHONY: build
build: build-webui
go generate
go build -tags webui -ldflags "$(LDFLAGS)" .
# produce a debugger-friendly build
.PHONY: build/debug
build/debug: build-webui
go generate
go build -tags webui -ldflags "$(LDFLAGS)" -gcflags=all="-N -l" .
.PHONY: install
install: build-webui
go generate
go install -tags webui -ldflags "$(LDFLAGS)" .
.PHONY: secure
secure:
go tool govulncheck ./...
.PHONY: test
test:
go test -v -bench=. ./...
.PHONY: clean-local-bugs
clean-local-bugs:
git for-each-ref refs/bugs/ | cut -f 2 | $(XARGS) -n 1 git update-ref -d
git for-each-ref refs/remotes/origin/bugs/ | cut -f 2 | $(XARGS) -n 1 git update-ref -d
rm -f .git/git-bug/bug-cache
.PHONY: clean-remote-bugs
clean-remote-bugs:
git ls-remote origin "refs/bugs/*" | cut -f 2 | $(XARGS) git push origin -d
.PHONY: clean-local-identities
clean-local-identities:
git for-each-ref refs/identities/ | cut -f 2 | $(XARGS) -n 1 git update-ref -d
git for-each-ref refs/remotes/origin/identities/ | cut -f 2 | $(XARGS) -n 1 git update-ref -d
rm -f .git/git-bug/identity-cache
.PHONY: clean-remote-identities
clean-remote-identities:
git ls-remote origin "refs/identities/*" | cut -f 2 | $(XARGS) git push origin -d