[build] Introduce build_info API module

The introduction of this file is to provide information for downstream
consumers of build artifacts (like ManagedOS and signing server) to
inspect what 'kind' of build they are looking at (usually to verify that
it is indeed a user build that they are looking at). This is meant to
replace the current look-up mechanism of string matching within args.gn
(which is only meant to be internal GN API).

Bug: 45302
Change-Id: I74b616a876de34e39d7bd7b3ad7fd374aad36088
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/375019
Commit-Queue: Joshua Seaton <joshuaseaton@google.com>
Reviewed-by: James Tucker <raggi@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 0bc6067..75f3b92 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -6,6 +6,7 @@
 import("//build/config/fuchsia/zbi.gni")
 import("//build/config/fuchsia/zircon.gni")
 import("//build/images/args.gni")
+import("//build/info/info.gni")
 import("//build/testing/platforms.gni")
 import("//build/toolchain/ccache.gni")
 import("//build/toolchain/goma.gni")
@@ -191,6 +192,7 @@
   data_keys = [ "build_api_modules" ]
   deps = [
     ":binaries",
+    ":build_info",
     ":fuzzers",
     ":images",
     ":platforms",
@@ -235,6 +237,36 @@
   }
 }
 
+# Describes the configuration of the build.
+#
+# Type: list(scope)
+#
+#   version
+#     Optional: The version of the build. Present during official builds.
+#     Type: string
+#
+#   configurations
+#     Required: The list of product/board configurations within the build.
+#     Each `configurations` entry is a scope that contains both a product
+#     and board specification.
+#     Type: list(scope)
+#
+build_api_module("build_info") {
+  testonly = true
+  contents = {
+    version = build_info_version
+
+    # A list to accommodate the future of a build that support building multiple
+    # (board, product) pairs.
+    configurations = [
+      {
+        board = build_info_board
+        product = build_info_product
+      },
+    ]
+  }
+}
+
 # Describes the "fuzzers" in the build.
 #
 # See //build/fuzzing/fuzzer.gni for more details.