Skip to content

Instantly share code, notes, and snippets.

@savelee
Last active March 15, 2021 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save savelee/19fcdc735ecd613faaaf13e5a2a5864e to your computer and use it in GitHub Desktop.
Save savelee/19fcdc735ecd613faaaf13e5a2a5864e to your computer and use it in GitHub Desktop.
Generate Google Cloud dart files from protobuffers
#!/usr/bin/env bash
if [ ! -d "$PROTOBUF" ]; then
echo "Please set the PROTOBUF environment variable to your clone of google/protobuf."
exit -1
fi
if [ ! -d "$GOOGLEAPIS" ]; then
echo "Please set the GOOGLEAPIS environment variable to your clone of googleapis/googleapis."
exit -1
fi
$PROTOC $GOOGLEAPIS/google/logging/v2/logging.proto
$PROTOC $GOOGLEAPIS/google/logging/v2/log_entry.proto
$PROTOC $GOOGLEAPIS/google/logging/type/log_severity.proto
$PROTOC $GOOGLEAPIS/google/logging/type/http_request.proto
$PROTOC $GOOGLEAPIS/google/api/monitored_resource.proto
$PROTOC $GOOGLEAPIS/google/api/label.proto
$PROTOC $GOOGLEAPIS/google/api/launch_stage.proto
$PROTOC $GOOGLEAPIS/google/rpc/status.proto
$PROTOC $GOOGLEAPIS/google/type/*.proto
$PROTOC $GOOGLEAPIS/google/longrunning/operations.proto
$PROTOC $GOOGLEAPIS/google/cloud/dialogflow/v2/*.proto
$PROTOC $GOOGLEAPIS/google/cloud/dialogflow/v2beta1/*.proto
$PROTOC $GOOGLEAPIS/google/cloud/dialogflow/cx/v3/*.proto
$PROTOC $GOOGLEAPIS/google/cloud/dialogflow/cx/v3beta1/*.proto
$PROTOC $PROTOBUF/src/google/protobuf/*.proto
dartfmt -w lib/src/generated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment