chore: update protobuf * gRPC toolchains
This commit is contained in:
@@ -10,16 +10,28 @@ See [API documentation](..\docs\apis.md)
|
||||
|
||||
##### Installling tools
|
||||
|
||||
Download the [Protocol Buffers compiler](https://github.com/protocolbuffers/protobuf/releases) (protoc-3.11.4-*) for your platform and add `protoc` to `PATH` environment variable
|
||||
Download the [Protocol Buffers compiler](https://github.com/protocolbuffers/protobuf/releases) (protoc-3.13.0-*) for your platform and add `protoc` to `PATH` environment variable
|
||||
|
||||
For generating Go code:
|
||||
For generating Go code, install `protoc-gen-go` (v1.32.0):
|
||||
```bash
|
||||
GIT_TAG="v1.4.0"
|
||||
go get -d -u github.com/golang/protobuf/protoc-gen-go
|
||||
git -C "$(go env GOPATH)"/src/github.com/golang/protobuf checkout $GIT_TAG
|
||||
go install github.com/golang/protobuf/protoc-gen-go
|
||||
GIT_TAG="v1.32.0"
|
||||
go get -d -u google.golang.org/protobuf/cmd/protoc-gen-go
|
||||
git -C "$(go env GOPATH)"/src/google.golang.org/protobuf checkout $GIT_TAG
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go
|
||||
```
|
||||
(Update to google.golang.org/protobuf when https://github.com/grpc/grpc-go/pull/3435 resolves)
|
||||
|
||||
Also install `protoc-gen-go-grpc`:
|
||||
```bash
|
||||
go get -u google.golang.org/protobuf/cmd/protoc-gen-go
|
||||
```
|
||||
|
||||
Or install using [gobin](https://github.com/myitcv/gobin):
|
||||
```bash
|
||||
gobin google.golang.org/protobuf/cmd/protoc-gen-go
|
||||
gobin google.golang.org/grpc/cmd/protoc-gen-go-grpc
|
||||
```
|
||||
|
||||
For generating HTTP JSON APIs with [grpc-gateway](https://grpc-ecosystem.github.io/grpc-gateway/), follow the [documentation](https://github.com/grpc-ecosystem/grpc-gateway/tree/v2#installation).
|
||||
|
||||
For generating Java code: From `bdledger-sdk-java` run `gradle generateProto`
|
||||
|
||||
@@ -50,7 +62,7 @@ References:
|
||||
|
||||
Run:
|
||||
```bash
|
||||
./scripts/gen [-a, --async] [go] [nodejs] [ts] [docs]
|
||||
./scripts/gen [-a, --async] [go] [gohttp] [nodejs] [ts] [docs]
|
||||
```
|
||||
Use `-a` or `--async` to speed up generation by asynchronously and concurrently generating all code and documentation (script will exit without waiting for completion)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ for %%A in (%*) do (
|
||||
set out=%gen%\go
|
||||
if not exist !out! mkdir !out!
|
||||
echo Generating Go code
|
||||
!exec! --go_out=plugins=grpc:!out! --govalidators_out=!out! %pbs%
|
||||
!exec! --go-grpc_out=!out! --govalidators_out=!out! %pbs%
|
||||
)
|
||||
if "%%A"=="gohttp" (
|
||||
set plugin=protoc-gen-grpc-gateway
|
||||
|
||||
@@ -46,7 +46,7 @@ do
|
||||
mkdir -p $out
|
||||
fi
|
||||
echo "Generating Go code"
|
||||
$exec --go_out=plugins=grpc:$out --govalidators_out=$out $pb_files $async_tag
|
||||
$exec --go-grpc_out=$out --govalidators_out=$out $pb_files $async_tag
|
||||
fi
|
||||
if [ $aug == "gohttp" ]; then
|
||||
plugin=protoc-gen-grpc-gateway
|
||||
|
||||
Reference in New Issue
Block a user