Browse Source

Replace custom BASH script with make equivalent

Signed-off-by: Thane Thomson <connect@thanethomson.com>
pull/7975/head
Thane Thomson 3 years ago
parent
commit
8786f1645c
No known key found for this signature in database GPG Key ID: 19811391D676EE45
2 changed files with 9 additions and 18 deletions
  1. +9
    -1
      Makefile
  2. +0
    -17
      scripts/proto-gen.sh

+ 9
- 1
Makefile View File

@ -76,6 +76,13 @@ $(BUILDDIR)/:
### Protobuf ###
###############################################################################
PROTO_INPUT_DIR := ./proto
PROTO_OUTPUT_DIR := ./proto
PROTO_PLUGIN := gogofaster
PROTO_PLUGIN_OPTS := Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,plugins=grpc,paths=source_relative
PROTO_INCLUDES := -I=$(PROTO_INPUT_DIR) -I=./third_party/proto/
PROTO_COMPILE := protoc $(PROTO_INCLUDES) --$(PROTO_PLUGIN)_out=$(PROTO_PLUGIN_OPTS):$(PROTO_OUTPUT_DIR)
check-proto-gen-deps:
ifeq (,$(shell which protoc))
$(error "Protocol buffers compiler protoc is required. See https://github.com/protocolbuffers/protobuf/#protocol-compiler-installation for installation instructions.")
@ -87,7 +94,8 @@ endif
proto-gen: check-proto-gen-deps
@echo "Generating Protobuf files"
@./scripts/proto-gen.sh
@find $(PROTO_INPUT_DIR) -name '*.proto' -exec $(PROTO_COMPILE) {} \;
@mv $(PROTO_INPUT_DIR)/tendermint/abci/types.pb.go ./abci/types/
.PHONY: proto-gen
check-proto-lint-deps:


+ 0
- 17
scripts/proto-gen.sh View File

@ -1,17 +0,0 @@
#!/usr/bin/bash
#
# Protobuf code generation script.
#
# To be run from the root of the Tendermint repository.
#
set -euo pipefail
INPUT_DIR=${INPUT_DIR:-./proto}
PLUGIN=${PLUGIN:-gogofaster}
PLUGIN_OPTS=${PLUGIN_OPTS:-"Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,plugins=grpc,paths=source_relative"}
OUTPUT_DIR=${OUTPUT_DIR:-./proto}
INCLUDES="-I=./third_party/proto/ -I=${INPUT_DIR}"
PROTOC="protoc ${INCLUDES} --${PLUGIN}_out=${PLUGIN_OPTS}:${OUTPUT_DIR}"
find ${INPUT_DIR} -name '*.proto' -exec ${PROTOC} {} \;

Loading…
Cancel
Save