Nan Zhang | 17f2767 | 2018-12-12 16:01:49 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Patrice Arruda | 1e2cad9 | 2020-10-12 22:58:27 +0000 | [diff] [blame^] | 3 | # Generates the golang source file of metrics.proto protobuf file. |
| 4 | |
| 5 | set -e |
| 6 | |
| 7 | function die() { echo "ERROR: $1" >&2; exit 1; } |
| 8 | |
| 9 | readonly error_msg="Maybe you need to run 'lunch aosp_arm-eng && m aprotoc blueprint_tools'?" |
| 10 | |
| 11 | if ! hash aprotoc &>/dev/null; then |
| 12 | die "could not find aprotoc. ${error_msg}" |
| 13 | fi |
| 14 | |
| 15 | if ! aprotoc --go_out=paths=source_relative:. metrics.proto; then |
| 16 | die "build failed. ${error_msg}" |
| 17 | fi |