Skip to content
Open
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
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
DIR=pb/go
INCLUDE_GOOGLE_PB_PATH=/usr/local/include
all:
all: clean_dir create_dir trpc_api trpc_reflection trpc_core trpc_v2_api trpc_v2_core

clean_dir:
rm -rf $(DIR)

create_dir:
mkdir -p $(DIR)

trpc_api:
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

trpc_reflection:
trpc create -p ./trpc/reflection/reflection.proto -o ./$(DIR)/trpc/reflection/ --rpconly --mock=false
cd ./$(DIR)/trpc/reflection && rm -f go.mod go.sum && go mod init trpc.group/trpc/trpc-protocol/$(DIR)/trpc/reflection && go mod edit -go=1.18 && go mod tidy && cd -

trpc_core:
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
./trpc/validate/validate.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
trpc_v2_api:
protoc -I$(INCLUDE_GOOGLE_PB_PATH) -I.\
--go_out=paths=source_relative:./$(DIR) \
./trpc/v2/api/annotations.proto \
./trpc/v2/api/http.proto

trpc_v2_core:
protoc -I$(INCLUDE_GOOGLE_PB_PATH) -I.\
--go_out=./$(DIR) \
./trpc/v2/trpc.proto \
Expand Down
40 changes: 10 additions & 30 deletions pb/go/trpc/api/annotations.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading