@@ -24,9 +24,7 @@ COLOR := "\e[1;36m%s\e[0m\n"
24
24
PINNED_DEPENDENCIES := \
25
25
26
26
PROTO_ROOT := proto/api
27
- PROTO_FILES = $(shell find $(PROTO_ROOT ) /temporal -name "* .proto")
28
- PROTO_DIRS = $(sort $(dir $(PROTO_FILES ) ) )
29
- PROTO_ENUMS := $(shell grep -R '^enum ' $(PROTO_ROOT ) | cut -d ' ' -f2)
27
+ PROTO_CLOUD_ROOT := proto/api-cloud
30
28
PROTO_OUT := .
31
29
PROTO_IMPORTS = \
32
30
-I=$(PROTO_ROOT )
@@ -57,10 +55,10 @@ go-grpc: clean .go-helpers-installed $(PROTO_OUT)
57
55
printf $(COLOR ) " Compile for go-gRPC..."
58
56
go run ./cmd/protogen \
59
57
--root=$(PROTO_ROOT ) \
58
+ --root=$(PROTO_CLOUD_ROOT ) \
60
59
--output=$(PROTO_OUT ) \
61
60
--exclude=internal \
62
61
--exclude=proto/api/google \
63
- -I $(PROTO_ROOT ) \
64
62
-p go-grpc_out=$(PROTO_PATHS ) \
65
63
-p grpc-gateway_out=allow_patch_feature=false,$(PROTO_PATHS ) \
66
64
-p go-helpers_out=$(PROTO_PATHS )
@@ -80,14 +78,11 @@ copy-helpers:
80
78
cp $(PROTO_OUT ) /internal/temporalcommonv1/payload_json.go $(PROTO_OUT ) /common/v1/
81
79
chmod -w $(PROTO_OUT ) /common/v1/payload_json.go
82
80
83
- # All generated service files pathes relative to PROTO_OUT.
84
- PROTO_GRPC_SERVICES = $(patsubst $(PROTO_OUT ) /% ,% ,$(shell find $(PROTO_OUT ) -name "service_grpc.pb.go") )
85
- service_name = $(firstword $(subst /, ,$(1 ) ) )
86
- mock_file_name = $(call service_name,$(1 ) ) mock/$(subst $(call service_name,$(1 ) ) /,,$(1:go=mock.go ) )
87
-
88
81
grpc-mock :
89
82
printf $(COLOR ) " Generate gRPC mocks..."
90
- $(foreach PROTO_GRPC_SERVICE,$(PROTO_GRPC_SERVICES ) ,cd $(PROTO_OUT ) && mockgen -package $(call service_name,$(PROTO_GRPC_SERVICE ) ) mock -source $(PROTO_GRPC_SERVICE ) -destination $(call mock_file_name,$(PROTO_GRPC_SERVICE ) )$(NEWLINE ) )
83
+ mockgen -package operatorservicemock -source operatorservice/v1/service_grpc.pb.go -destination operatorservicemock/v1/service_grpc.pb.mock.go
84
+ mockgen -package workflowservicemock -source workflowservice/v1/service_grpc.pb.go -destination workflowservicemock/v1/service_grpc.pb.mock.go
85
+ mockgen -package cloudservicemock -source cloud/cloudservice/v1/service_grpc.pb.go -destination cloud/cloudservicemock/v1/service_grpc.pb.mock.go
91
86
92
87
.PHONY : proxy
93
88
proxy :
@@ -146,3 +141,5 @@ clean:
146
141
printf $(COLOR ) " Deleting generated go files..."
147
142
# Delete all directories with *.pb.go and *.mock.go files from $(PROTO_OUT)
148
143
find $(PROTO_OUT ) \( -name " *.pb.go" -o -name " *.mock.go" -o -name " *.go-helpers.go" \) | xargs -I{} dirname {} | egrep -v ' testprotos' | sort -u | xargs rm -rf
144
+ # Delete entire cloud dir
145
+ rm -rf cloud
0 commit comments