xref: /aosp_15_r20/build/soong/ui/metrics/metrics_proto/regen.sh (revision 333d2b3687b3a337dbcca9d65000bca186795e39)
1#!/bin/bash
2
3# Generates the golang source file of metrics.proto protobuf file.
4
5set -e
6
7function die() { echo "ERROR: $1" >&2; exit 1; }
8
9readonly error_msg="Maybe you need to run 'lunch aosp_arm-eng && m aprotoc blueprint_tools'?"
10
11if ! hash aprotoc &>/dev/null; then
12  die "could not find aprotoc. ${error_msg}"
13fi
14
15if ! aprotoc --go_out=paths=source_relative:. -I .:../../.. metrics.proto combined_metrics.proto; then
16  die "build failed. ${error_msg}"
17fi
18