-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (31 loc) · 1.16 KB
/
Makefile
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
27
28
29
30
31
32
33
34
35
AWI_UI_PATH=../awi-ui
.PHONY: all
all: generate mocks
.PHONY: generate
generate:
rm -rf pb/* js/* ts/*
protoc --proto_path=proto \
\
--go_out=pb/ --go_opt=paths=source_relative --golang-deepcopy_out=:pb/ \
--go-grpc_out=pb/ --go-grpc_opt=paths=source_relative \
\
--plugin="node_modules/.bin/protoc-gen-ts_proto" --ts_proto_out=ts \
--ts_proto_opt=env=browser,outputServices=nice-grpc,outputServices=generic-definitions,outputJsonMethods=false,useExactTypes=false,esModuleInterop=true \
\
--js_out=import_style=commonjs:js --grpc-web_out=import_style=commonjs,mode=grpcwebtext:js \
proto/*.proto
@if [ -d "$(AWI_UI_PATH)" ]; then \
@echo "Copying generated files to awi-ui directory..."; \
rm -rf ${AWI_UI_PATH}/src/_proto/grpc-service/ts/*; \
cp -r ts/* ${AWI_UI_PATH}/src/_proto/grpc-service/ts/; \
fi
.PHONY: tools
tools:
go install istio.io/tools/cmd/protoc-gen-golang-deepcopy@latest
go install github.com/vektra/mockery/v2@v2.32.0
npm install
@echo "\033[1;33m\nInstall protoc-gen-grpc-web based on instructions from https://github.com/grpc/grpc-web#code-generator-plugin"
.PHONY: mocks
mocks:
rm -rf mocks/*
mockery --with-expecter --all