Skip to content

Commit

Permalink
Merge pull request cockroachdb#6 from ahrtr/cleanup_proto_20221129
Browse files Browse the repository at this point in the history
cleanup unnecessary tools/plugins in genproto.sh and tools/mod
  • Loading branch information
ahrtr authored Dec 1, 2022
2 parents ecfcf0a + 05d91d0 commit eaa6808
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 72 deletions.
8 changes: 1 addition & 7 deletions scripts/genproto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@ if [[ $(protoc --version | cut -f2 -d' ') != "3.14.0" ]]; then
fi

GOFAST_BIN=$(tool_get_bin github.com/gogo/protobuf/protoc-gen-gofast)
GRPC_GATEWAY_BIN=$(tool_get_bin github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway)
SWAGGER_BIN=$(tool_get_bin github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger)
GOGOPROTO_ROOT="$(tool_pkg_dir github.com/gogo/protobuf/proto)/.."
GRPC_GATEWAY_ROOT="$(tool_pkg_dir github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway)/.."

echo
echo "Resolved binary and packages versions:"
echo " - protoc-gen-gofast: ${GOFAST_BIN}"
echo " - protoc-gen-grpc-gateway: ${GRPC_GATEWAY_BIN}"
echo " - swagger: ${SWAGGER_BIN}"
echo " - gogoproto-root: ${GOGOPROTO_ROOT}"
echo " - grpc-gateway-root: ${GRPC_GATEWAY_ROOT}"
GOGOPROTO_PATH="${GOGOPROTO_ROOT}:${GOGOPROTO_ROOT}/protobuf"

# directories containing protos to be built
Expand All @@ -40,7 +34,7 @@ log_callout -e "\\nRunning gofast (gogo) proto generation..."

for dir in ${DIRS}; do
pushd "${dir}"
protoc --gofast_out=plugins=grpc:. -I=".:${GOGOPROTO_PATH}:${RAFT_ROOT_DIR}/..:${RAFT_ROOT_DIR}:${GRPC_GATEWAY_ROOT}/third_party/googleapis" \
protoc --gofast_out=. -I=".:${GOGOPROTO_PATH}:${RAFT_ROOT_DIR}/..:${RAFT_ROOT_DIR}" \
--plugin="${GOFAST_BIN}" ./**/*.proto

sed -i.bak -E 's|"raft/raftpb"|"go.etcd.io/etcd/raft/v3/raftpb"|g' ./**/*.pb.go
Expand Down
6 changes: 1 addition & 5 deletions tools/mod/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/gogo/protobuf v1.3.2
github.com/google/addlicense v1.0.0
github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/gyuho/gocovmerge v0.0.0-20171205171859-50c7e6afd535
github.com/hexfusion/schwag v0.0.0-20211117114134-3ceb0191ccbf
github.com/mdempsky/unconvert v0.0.0-20200228143138-95ecdbfc0b5f
Expand Down Expand Up @@ -37,7 +36,6 @@ require (
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/analysis v0.21.2 // indirect
github.com/go-openapi/errors v0.19.9 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
Expand All @@ -48,9 +46,8 @@ require (
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/goccy/go-yaml v1.9.5 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.3.3 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
Expand Down Expand Up @@ -81,7 +78,6 @@ require (
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 // indirect
gopkg.in/op/go-logging.v1 v1.0.0-20160211212156-b2cb9fa56473 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit eaa6808

Please sign in to comment.