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
16 changes: 12 additions & 4 deletions pkg/client/v1/proto/Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
.PHONY: proto install-deps help

proto:
@echo "Generating gRPC code from proto files using protoc-gen-gogo..."
@echo "Generating message bindings with protoc-gen-gogo..."
@cd ../../../.. && go mod vendor
@protoc \
--proto_path=. \
--proto_path=../../../../vendor \
--gogo_out=. \
--gogo_opt=paths=source_relative \
storage_service.proto
@echo "Generating gRPC service stubs with protoc-gen-go-grpc..."
@protoc \
--proto_path=. \
--proto_path=../../../../vendor \
--go-grpc_out=. \
--go-grpc_opt=paths=source_relative \
storage_service.proto
@cd ../../../.. && rm -rf vendor
@echo "Proto generation complete!"
@echo ""
@echo "IMPORTANT: Commit the generated files (*.pb.go, *_grpc.pb.go) to the repository"
@echo " You can delete the vendor directory after generation"

install-deps:
@echo "Installing protoc dependencies..."
go install github.com/gogo/protobuf/protoc-gen-gogo@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
@echo "Dependencies installed!"

help:
@echo "Available targets:"
@echo " make install-deps - Install protoc-gen-gogo"
@echo " make proto - Generate Go code from proto files using gogo (runs go mod vendor first)"
@echo " make install-deps - Install protoc-gen-gogo + protoc-gen-go-grpc"
@echo " make proto - Generate Go code from proto files (messages via gogo, services via go-grpc)"
@echo ""
@echo "After running 'make proto', commit the generated files to git:"
@echo " git add *.pb.go *_grpc.pb.go"
Expand Down
Loading
Loading