Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,32 @@ update-proto-submodule:
printf $(COLOR) "Update proto-submodule..."
git -c protocol.file.allow=always submodule update --init --force --remote $(PROTO_ROOT)

##### Compile proto files for go #####
grpc: http-api-docs go-grpc copy-helpers
NEXUS_SCHEMA_ROOT := $(PROTO_ROOT)/nexus
NEXUS_PROTO_OUT := workflowservice/v1/workflowservicenexus
NEXUS_JSON_OUT := workflowservice/v1/workflowservicenexus/json

# Only install helper when its source has changed
##### Compile proto files for go #####
grpc: http-api-docs go-grpc copy-helpers nexus-gen

nexus-gen:
printf $(COLOR) "Generate nexus service definitions..."
mkdir -p $(NEXUS_PROTO_OUT) $(NEXUS_JSON_OUT)
cd $(NEXUS_SCHEMA_ROOT) && nexus-rpc-gen \
--lang go \
--package workflowservicenexus \
--out-file $(CURDIR)/$(NEXUS_PROTO_OUT)/service_nexus.pb.go \
temporal-proto-models-nexusrpc.yaml
cd $(NEXUS_SCHEMA_ROOT) && nexus-rpc-gen \
--lang go \
--package json \
--temporal-nexus-payload-codec-support \
--out-file $(CURDIR)/$(NEXUS_JSON_OUT)/service_nexus.go \
temporal-json-schema-models-nexusrpc.yaml

# Only install helpers when their source has changed
HELPER_FILES = $(shell find ./cmd/protoc-gen-go-helpers)
.go-helpers-installed: $(HELPER_FILES)
printf $(COLOR) "Installing protoc plugin"
printf $(COLOR) "Installing protoc-gen-go-helpers plugin"
@go install ./cmd/protoc-gen-go-helpers
@touch $@

Expand Down Expand Up @@ -104,12 +123,24 @@ gen-proto-desc:
--output-descriptor=$(PROTO_OUT)/descriptor_set.pb

##### Plugins & tools #####
grpc-install:
grpc-install: nexus-rpc-gen-install
@printf $(COLOR) "Install/update grpc and plugins..."
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for removing the whitespace. The print was okay though. It's not all GRPC plugins. You can maybe change it to protoc plugins.

@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

NEXUS_RPC_GEN_CACHE := $(HOME)/.cache/nexus-rpc-gen

.PHONY: nexus-rpc-gen-install
nexus-rpc-gen-install:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would mark this as a PHONY target

# TODO seankane: install the src from CDN
@printf $(COLOR) "Install nexus-rpc-gen from GitHub branch (tconley-go-payload-codec-support)..."
@rm -rf $(NEXUS_RPC_GEN_CACHE)
@git clone --depth 1 --branch tconley-go-payload-codec-support https://github.com/nexus-rpc/nexus-rpc-gen.git $(NEXUS_RPC_GEN_CACHE)
@cd $(NEXUS_RPC_GEN_CACHE)/src && pnpm install && pnpm run build
@chmod +x $(NEXUS_RPC_GEN_CACHE)/src/packages/nexus-rpc-gen/dist/index.js
@cd $(NEXUS_RPC_GEN_CACHE)/src/packages/nexus-rpc-gen && pnpm link --global

mockgen-install:
printf $(COLOR) "Install/update mockgen..."
go install -modfile=build/go.mod github.com/golang/mock/mockgen
Expand Down
37 changes: 37 additions & 0 deletions activity/v1/message.go-helpers.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading