-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (31 loc) · 1.38 KB
/
Makefile
File metadata and controls
39 lines (31 loc) · 1.38 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
.PHONY: gomods
gomods: ## Install gomods
go install github.com/jmank88/gomods@v0.1.6
.PHONY: tidy
tidy: gomods ## Tidy go.mod and go.sum files
gomods tidy
.PHONY: mockery
mockery: ## Install mockery
go install github.com/vektra/mockery/v2@v2.53.3
.PHONY: codecgen
codecgen: ## Install codecgen
go install github.com/ugorji/go/codec/codecgen@v1.2.10
.PHONY: protoc
protoc: ## Install protoc
./tools/bin/install-protoc.sh 29.3 /
go install google.golang.org/protobuf/cmd/protoc-gen-go@`go list -m -json google.golang.org/protobuf | jq -r .Version`
.PHONY: generate
generate: gomods codecgen mockery protoc modgraph ## Generate code for all modules
export PATH="$(HOME)/.local/bin:$(PATH)"; gomods -s gethwrappers,contracts/cre/ -go generate ./...
find . -type f -name .mockery.yaml -not -path "./contracts/" -not -path "./gethwrappers/" -execdir mockery \; ## Execute mockery for all .mockery.yaml files
.PHONY: rm-mocked
rm-mocked: ## Remove mocked code
grep -rl "^// Code generated by mockery" | grep --exclude-dir ./contracts/ --exclude-dir ./gethwrappers/ .go$ | xargs -r rm
.PHONY: modgraph
modgraph: gomods ## Generate module graph
go install github.com/jmank88/modgraph@v0.1.0
./modgraph > go.md
.PHONY: help
help: ## Show help for all targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'