-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (21 loc) · 832 Bytes
/
Makefile
File metadata and controls
26 lines (21 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
PYTHON:=python
PROTO_SRC=proto
PROTO_OUT=fact
PROTO_OUT_UI=ui/proto
PROTOS= \
controller \
management \
tasks
PROTOS_UI= \
management \
tasks
.PHONY: all
all:
.PHONY: proto
proto: $(addprefix $(PROTO_OUT)/,$(addsuffix _pb2.py,$(PROTOS)))
.PHONY: proto-ts
proto-ts: $(addprefix $(PROTO_OUT_UI)/$(PROTO_OUT)/,$(addsuffix .ts,$(PROTOS_UI)))
$(PROTO_OUT)/%_pb2.py: $(PROTO_SRC)/$(PROTO_OUT)/%.proto
$(PYTHON) -m grpc_tools.protoc -I$(PROTO_SRC) --python_out=. --grpc_python_out=. --mypy_out=. --proto_path=$(PROTO_SRC) $<
$(PROTO_OUT_UI)/$(PROTO_OUT)/%.ts: $(PROTO_SRC)/$(PROTO_OUT)/%.proto
$(PYTHON) -m grpc_tools.protoc -I$(PROTO_SRC) --plugin=ui/node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=$(PROTO_OUT_UI) --ts_proto_opt=esModuleInterop=true --ts_proto_opt=outputClientImpl=grpc-web --proto_path=$(PROTO_SRC) $<