forked from berty/berty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (65 loc) · 1.84 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
80
81
82
83
84
85
check-program = $(foreach exec,$(1),$(if $(shell PATH="$(PATH)" which $(exec)),,$(error "Missing deps: no '$(exec)' in PATH")))
all: generate test
.PHONY: all
test:
cd go; $(MAKE) test
cd js; $(MAKE) test
cd js; $(MAKE) lint
.PHONY: test
generate:
$(call check-program, go)
$(shell find ../api -type f -name '*.proto' -exec touch {} \;) # touch all proto files to force regeneration
cd go; $(MAKE) generate
cd docs; $(MAKE) generate
cd js; $(MAKE) generate
cd config; $(MAKE) generate
go mod tidy
.PHONY: generate
regenerate:
$(call check-program, go)
$(shell find ../api -type f -name '*.proto' -exec touch {} \;) # touch all proto files to force regeneration
cd go; $(MAKE) regenerate
cd docs; $(MAKE) regenerate
cd js; $(MAKE) regenerate
cd config; $(MAKE) generate
go mod tidy
.PHONY: regenerate
tidy:
$(call check-program, go)
go mod tidy
cd js; go mod tidy
cd tool/tyber/go; go mod tidy
.PHONY: tidy
docker.build:
cd go; $(MAKE) docker.build
.PHONY: docker.build
goreleaser.dry-run:
$(call check-program, goreleaser)
goreleaser release --rm-dist --snapshot --skip-publish
.PHONY: goreleaser.dry-run
doctor:
cd go && $(MAKE) doctor
.PHONY: doctor
doctor.verbose:
cd go && $(MAKE) doctor.verbose
.PHONY: doctor.verbose
clean:
-cd tool/berty-mini/local-helper; $(MAKE) clean
-cd tool/tyber; $(MAKE) clean
-cd tool/deployments/welcomebot; $(MAKE) clean
-cd tool/deployments/testbot; $(MAKE) clean
-cd go; $(MAKE) clean
-cd docs; $(MAKE) clean
-cd js; $(MAKE) clean
.PHONY: clean
asdf.install_plugins:
$(call check-program, asdf)
@echo "Installing asdf plugins..."
@set -e; \
for PLUGIN in $$(cut -d' ' -f1 .tool-versions | grep "^[^\#]"); do \
asdf plugin add $$PLUGIN || [ $$?==2 ] || exit 1; \
done
asdf.install_tools: asdf.install_plugins
$(call check-program, asdf)
@echo "Installing asdf tools..."
@asdf install