You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
613 B

  1. #!/usr/bin/bash
  2. #
  3. # Protobuf code generation script.
  4. #
  5. # To be run from the root of the Tendermint repository.
  6. #
  7. set -euo pipefail
  8. INPUT_DIR=${INPUT_DIR:-./proto}
  9. PLUGIN=${PLUGIN:-gogofaster}
  10. 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"}
  11. OUTPUT_DIR=${OUTPUT_DIR:-./proto}
  12. INCLUDES="-I=./third_party/proto/ -I=${INPUT_DIR}"
  13. PROTOC="protoc ${INCLUDES} --${PLUGIN}_out=${PLUGIN_OPTS}:${OUTPUT_DIR}"
  14. find ${INPUT_DIR} -name '*.proto' -exec ${PROTOC} {} \;