From 64a6b8ad5948214cfdfdce7955882a00e47b1a21 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 7 Aug 2023 09:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=84=9A=E6=9C=AC=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/README.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/build/README.md b/build/README.md index 73af402..a94ff80 100644 --- a/build/README.md +++ b/build/README.md @@ -1,3 +1,31 @@ -每次 `.proto` 文件有更新的时候,请运行 `build.sh` 重新生成相应的源代码。 +# 脚本使用指南 -如果文件名有更改,请清空 `pkg/rpc/pb/*.go` 文件,然后再次运行 `build.sh`。 \ No newline at end of file +## 编译多语言相关源文件 +~~~bash +./build-messages.sh +~~~ + +## 编译API相关源文件 +在使用 `build.sh` 编译 `.proto` 文件之前,你需要确保已经为 `protoc` 安装了对应的插件: +~~~bash +# install protoc-gen-go plugin +go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + +# install protoc-gen-go-grpc plugin +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +~~~ + +之后每次 `.proto` 文件有更新的时候,请运行 `build.sh` 重新生成相应的Go源代码和`rpc.json`文件: +~~~bash +./build.sh +~~~ + +如果文件名有更改,请清空 `pkg/rpc/pb/*.go` 文件,然后再次运行 `build.sh`。 + + +## 生成RPC列表文件 +运行: +~~~bash +./proto-json.sh +~~~ +可以重新生成 `rpc.json` 文件。 \ No newline at end of file