mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-27 09:15:15 +00:00
update makefile for grpc and grpc tools
This commit is contained in:
parent
fb6834a261
commit
ca19c9d592
28
Makefile
28
Makefile
|
@ -235,10 +235,26 @@ embed: pkg/server/assets.go
|
|||
|
||||
static: frontend/out/index.html pkg/server/assets.go
|
||||
|
||||
|
||||
PROTOS := \
|
||||
$(wildcard pkg/pb/*.proto)
|
||||
|
||||
GRPC_GO_DEPS := $(subst .proto,.pb.go,$(PROTOS))
|
||||
|
||||
%.pb.go: %.proto .FORCE
|
||||
protoc --go-grpc_out=. --go_out=. --proto_path=. $<
|
||||
|
||||
grpc: $(GRPC_GO_DEPS) grpc-py
|
||||
|
||||
install-grpc-tools:
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
|
||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
|
||||
pip install grpcio-tools
|
||||
|
||||
grpc-py:
|
||||
python -m grpc_tools.protoc -I$(PWD)/pkg/pb \
|
||||
--python_out=$(PWD)/python/bbgo \
|
||||
--grpc_python_out=$(PWD)/python/bbgo \
|
||||
$(PWD)/pkg/pb/bbgo.proto
|
||||
|
||||
.PHONY: bbgo bbgo-slim-darwin bbgo-slim-darwin-amd64 bbgo-slim-darwin-arm64 bbgo-darwin version dist pack migrations static embed desktop .FORCE
|
||||
|
||||
protobuf:
|
||||
protoc -I=$(PWD)/pkg/pb --go_out=$(PWD)/pkg/pb $(PWD)/pkg/pb/bbgo.proto
|
||||
|
||||
protobuf-py:
|
||||
python -m grpc_tools.protoc -I$(PWD)/pkg/pb --python_out=$(PWD)/python/bbgo --grpc_python_out=$(PWD)/python/bbgo $(PWD)/pkg/pb/bbgo.proto
|
||||
|
|
Loading…
Reference in New Issue
Block a user