Skip to content
Merged
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
35 changes: 29 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,25 @@ 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

# 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)
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

# 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 @@ -105,12 +117,23 @@ 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

@printf $(COLOR) "Install nexus-rpc-gen from main..."
@rm -rf $(NEXUS_RPC_GEN_CACHE)
@git clone --depth 1 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
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/golang/mock v1.6.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0
github.com/nexus-rpc/nexus-proto-annotations v0.1.0
github.com/nexus-rpc/sdk-go v0.6.0
github.com/stretchr/testify v1.9.0
google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/nexus-rpc/nexus-proto-annotations v0.1.0 h1:2fELd+9sqUtNu6Fg//pw8YFsxOvp8vZ8hfP0nHhNI80=
github.com/nexus-rpc/nexus-proto-annotations v0.1.0/go.mod h1:n3UjF1bPCW8llR8tHvbxJ+27yPWrhpo8w/Yg1IOuY0Y=
github.com/nexus-rpc/sdk-go v0.6.0 h1:QRgnP2zTbxEbiyWG/aXH8uSC5LV/Mg1fqb19jb4DBlo=
github.com/nexus-rpc/sdk-go v0.6.0/go.mod h1:FHdPfVQwRuJFZFTF0Y2GOAxCrbIBNrcPna9slkGKPYk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
Expand Down
16 changes: 16 additions & 0 deletions workflowservice/v1/workflowservicenexus/service_nexus.pb.go

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

Loading