Define a proto file that generates the current build completion status.

Soong UI will generate a new proto file in the out directory for
other systems to read the build completion status during a course
of a build. The proto file contains build action counters where

total_actions: represents the total build actions of a build (will
increase and may decrease during a course of the build)

finished_actions: represents the number of executed build actions.
finished_actions never decreases and finished_actions <= total_actions.

current_actions: represents the number of build actions being executed
and current_actions + finished_actions <= total_actions.

Bug: 150401146
Test: executed regen.sh script.
Change-Id: I04f4c07855723d0684b141d88cb3529ab5d9fccd
diff --git a/ui/status/completion_proto/regen.sh b/ui/status/completion_proto/regen.sh
new file mode 100755
index 0000000..652df08
--- /dev/null
+++ b/ui/status/completion_proto/regen.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Generates the golang source file of build_completion.proto 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:. build_completion.proto; then
+  die "build failed. ${error_msg}"
+fi