-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (39 loc) · 1.28 KB
/
Makefile
File metadata and controls
43 lines (39 loc) · 1.28 KB
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
36
37
38
39
40
41
42
43
DIR=pb/go
INCLUDE_GOOGLE_PB_PATH=/usr/local/include
all:
rm -rf $(DIR)
mkdir -p $(DIR)
protoc -I$(INCLUDE_GOOGLE_PB_PATH) -I.\
--go_out=paths=source_relative:./$(DIR) \
./trpc/api/annotations.proto \
./trpc/api/http.proto \
./trpc/api/openapiv2.proto
protoc -I$(INCLUDE_GOOGLE_PB_PATH) -I.\
--go_out=./$(DIR) \
./trpc/trpc.proto \
./trpc/proto/trpc_options.proto \
./trpc/swagger/swagger.proto \
./trpc/validate/validate.proto \
./trpc/reflection/reflection.proto
mv $(DIR)/trpc.group/trpc/trpc-protocol/pb/go/trpc/* $(DIR)/trpc
rm -rf $(DIR)/trpc.group
cd ./$(DIR)/trpc && go mod init trpc.group/trpc/trpc-protocol/$(DIR)/trpc && go mod tidy && cd -
# trpc v2
protoc -I$(INCLUDE_GOOGLE_PB_PATH) -I.\
--go_out=paths=source_relative:./$(DIR) \
./trpc/v2/api/annotations.proto \
./trpc/v2/api/http.proto
protoc -I$(INCLUDE_GOOGLE_PB_PATH) -I.\
--go_out=./$(DIR) \
./trpc/v2/trpc.proto \
./trpc/v2/proto/trpc_options.proto \
./trpc/v2/swagger/swagger.proto \
./trpc/v2/validate/validate.proto
mv $(DIR)/trpc.group/trpc/trpc-protocol/pb/go/trpc/v2/* $(DIR)/trpc/v2
rm -rf $(DIR)/trpc.group
cd ./$(DIR)/trpc/v2 && go mod init trpc.group/trpc/trpc-protocol/$(DIR)/trpc/v2 && go mod tidy && cd -
.PHONY: test clean
test:
./testbuild.sh
clean:
rm -rf $(DIR)