Add bazel staging mode to soong build.
This is to use bazel to build targets that are being prepared for an
incipient release to the prod mode allowlist.
Bug: 254265047
Test: m nothing
Test: m nothing --bazel-mode-dev
Test: m nothing --bazel-mode-staging
Change-Id: Ic78a59cf51dba83ef1ac26483586560ea9b24aaf
diff --git a/ui/build/build.go b/ui/build/build.go
index 2022e50..b9bd898 100644
--- a/ui/build/build.go
+++ b/ui/build/build.go
@@ -112,9 +112,19 @@
// checkBazelMode fails the build if there are conflicting arguments for which bazel
// build mode to use.
func checkBazelMode(ctx Context, config Config) {
- if config.bazelProdMode && config.bazelDevMode {
+ count := 0
+ if config.bazelProdMode {
+ count++
+ }
+ if config.bazelDevMode {
+ count++
+ }
+ if config.bazelStagingMode {
+ count++
+ }
+ if count > 1 {
ctx.Fatalln("Conflicting bazel mode.\n" +
- "Do not specify both --bazel-mode and --bazel-mode-dev")
+ "Do not specify more than one of --bazel-mode and --bazel-mode-dev and --bazel-mode-staging ")
}
}