Patrice Arruda | adfc112 | 2020-04-03 08:40:19 -0700 | [diff] [blame] | 1 | #!/bin/bash |
2 | |||||
3 | # Generates the golang source file of upload.proto 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:. upload.proto; then | ||||
16 | die "build failed. ${error_msg}" | ||||
17 | fi |