@@ -20,6 +20,12 @@ SYFT_VERSION ?= v0.87.0
2020GORELEASER := $(BIN_DIR ) /goreleaser
2121GORELEASER_VERSION ?= v1.20.0
2222
23+ PROTOC_GO := $(BIN_DIR ) /protoc-gen-go
24+ PROTOC_GO_VERSION ?= v1.35.2
25+
26+ PROTOC_GO_GRPC := $(BIN_DIR ) /protoc-gen-go-grpc
27+ PROTOC_GO_GRPC_VERSION ?= v1.5.1
28+
2329RSTCHECK := $(shell command -v rstcheck)
2430MARKDOWNLINT := $(shell command -v mdl)
2531
@@ -74,11 +80,11 @@ showcoverage: test
7480 $(GO ) tool cover -html=profile.out
7581
7682.PHONY : generate
77- generate : keyservice/keyservice.pb.go
83+ generate : install-protoc-go install-protoc-go-grpc keyservice/keyservice.pb.go
7884 $(GO ) generate
7985
8086% .pb.go : % .proto
81- protoc --go_out=plugins= grpc: . $<
87+ protoc --plugin gen-go= $( PROTOC_GO ) --plugin gen-go- grpc= $( PLUGIN_GO_GRPC ) --go-grpc_opt=require_unimplemented_servers=false --go-grpc_out=. --go_out= . $<
8288
8389.PHONY : functional-tests
8490functional-tests :
@@ -112,6 +118,14 @@ install-goreleaser:
112118install-syft :
113119 $(call go-install-tool,$(SYFT ) ,github.com/anchore/syft/cmd/syft@$(SYFT_VERSION ) ,$(SYFT_VERSION ) )
114120
121+ .PHONY : install-protoc-go
122+ install-protoc-go :
123+ $(call go-install-tool,$(PROTOC_GO ) ,google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GO_VERSION ) ,$(PROTOC_GO_VERSION ) )
124+
125+ .PHONY : install-protoc-go-grpc
126+ install-protoc-go-grpc :
127+ $(call go-install-tool,$(PROTOC_GO_GRPC ) ,google.golang.org/grpc/cmd/protoc-gen-go-grpc@$(PROTOC_GO_GRPC_VERSION ) ,$(PROTOC_GO_GRPC_VERSION ) )
128+
115129# go-install-tool will 'go install' any package $2 and install it to $1.
116130define go-install-tool
117131@[ -f $(1 ) -$(3 ) ] || { \
0 commit comments