DEVP_PROTOC_GEN_GO_GRPC_VERSION = v1.6.0
DEVP_PROTOC_GEN_GO_GRPC_DIR = ${DEVP_TOOLS_ROOT}/protoc-gen-go-grpc/${DEVP_PROTOC_GEN_GO_GRPC_VERSION}
DEVP_PROTOC_GEN_GO_GRPC_EXE = ${DEVP_PROTOC_GEN_GO_GRPC_DIR}/protoc-gen-go-grpc

${DEVP_PROTOC_GEN_GO_GRPC_EXE}:
ifdef DEVP_NO_INSTALL
ifneq ($(DEVP_VERSION),$(DEVP_CI_BUILDER_VERSION))
	$(call error_message,"Platform version is [${DEVP_VERSION}] image version is [${DEVP_CI_BUILDER_VERSION}]. Same version is expected. Updating with [make devp/update] might help. DEVP_NO_INSTALL == 1. See: https://mws.pages.mws-team.ru/devp/platform-go-tools/pgt/user/pages/platform-update.html")
	@exit 1
endif
	$(call error_message,"[protoc-gen-go-grpc] is expected to be installed but it is not. Please contact /duty golang for support.")
	@exit 1
endif
	$(Q) mkdir -p ${DEVP_PROTOC_GEN_GO_GRPC_DIR}
	$(Q) CGO_ENABLED=0 GOBIN=${DEVP_PROTOC_GEN_GO_GRPC_DIR} go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${DEVP_PROTOC_GEN_GO_GRPC_VERSION}
	$(call green,"protoc-gen-go-grpc installed as $@")

.PHONY: devp/install/protoc-gen-go-grpc
devp/install/protoc-gen-go-grpc: ${DEVP_PROTOC_GEN_GO_GRPC_EXE}
	@# Install protoc-gen-go-grpc - v1.6.0

DEVP_PROTOC_GO_GRPC_CMD := ${DEVP_PROTOC_CMD} --plugin=protoc-gen-go=${DEVP_PROTOC_GEN_GO_EXE} --plugin=protoc-gen-go-grpc=${DEVP_PROTOC_GEN_GO_GRPC_EXE}
