From 1e2cad95c8141bf8b86dd027e5b9871812a9a059 Mon Sep 17 00:00:00 2001 From: Patrice Arruda Date: Mon, 12 Oct 2020 22:58:27 +0000 Subject: [PATCH] Add additional documentation in metrics proto regen.sh script. Added additional instruction in the regen.sh script to build the blueprint_tools and aprotoc in case the regen.sh script fails. Bug: b/169395325 Test: ./regen.sh Change-Id: Icb38c907fb47febc17eef1067d06d0588dd0b7ba --- ui/metrics/metrics_proto/regen.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ui/metrics/metrics_proto/regen.sh b/ui/metrics/metrics_proto/regen.sh index 343c638ac..8eb2d747b 100755 --- a/ui/metrics/metrics_proto/regen.sh +++ b/ui/metrics/metrics_proto/regen.sh @@ -1,3 +1,17 @@ #!/bin/bash -aprotoc --go_out=paths=source_relative:. metrics.proto +# Generates the golang source file of metrics.proto protobuf file. + +set -e + +function die() { echo "ERROR: $1" >&2; exit 1; } + +readonly error_msg="Maybe you need to run 'lunch aosp_arm-eng && m aprotoc blueprint_tools'?" + +if ! hash aprotoc &>/dev/null; then + die "could not find aprotoc. ${error_msg}" +fi + +if ! aprotoc --go_out=paths=source_relative:. metrics.proto; then + die "build failed. ${error_msg}" +fi