-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (33 loc) · 881 Bytes
/
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
.PHONY: init
# install required binaries
init:
make update
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install github.com/envoyproxy/protoc-gen-validate@latest
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
.PHONY: update
# update .lock files
update:
cd ./api/proto; \
buf mod update; \
cd ../..
.PHONY: api
# generate code from api definitions
api:
make update; \
buf generate
.PHONY: gen
# recursively invoke go:generate tool
gen:
go generate ./...
.PHONY: test
# run all project tests
test:
ginkgo -r --cover
.PHONY: build
# compile server application
build:
go build -o ./bin/server ./cmd/server/.