-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (38 loc) · 1.37 KB
/
Copy pathMakefile
File metadata and controls
46 lines (38 loc) · 1.37 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
.PHONY: proto install push evans
.DEFAULT_GOAL := proto
# Proto
PROTO_DIR = ./proto
PROTO_OUT = .
MODULE = github.com/nhassl3/servicehub-contracts
# All .proto files except vendored dependencies (googleapis, validate)
PROTO_FILES = $(shell find $(PROTO_DIR) -name "*.proto" \
-not -path "*/googleapis/*" \
-not -path "*/validate/*")
install:
@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/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@latest
@go install github.com/envoyproxy/protoc-gen-validate@latest
push:
@eval "$(ssh-agent -s)"
@ssh-add servicehub_contracts_sshkey
proto:
@mkdir -p $(PROTO_OUT)
@protoc \
--proto_path=$(PROTO_DIR) \
--proto_path=/usr/include \
--go_out=$(PROTO_OUT) \
--go_opt=module=$(MODULE) \
--go-grpc_out=$(PROTO_OUT) \
--go-grpc_opt=module=$(MODULE) \
--grpc-gateway_out=$(PROTO_OUT) \
--grpc-gateway_opt=module=$(MODULE) \
--grpc-gateway_opt=generate_unbound_methods=true \
--validate_out="lang=go:$(PROTO_OUT)" \
--validate_opt=module=$(MODULE) \
$(PROTO_FILES)
@echo "Successfully built protocol buffers code files"
evans:
@evans --path proto --proto auth/v1/auth.proto --host 127.0.0.1 -p 50051
notification-evans:
@evans --path proto --proto notification/v1/notification.proto --host 127.0.0.1 -p 50051