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/cmd/soong_build/main.go b/cmd/soong_build/main.go
index 0ba25c8..70f58f5 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -88,6 +88,7 @@
flag.StringVar(&cmdlineArgs.OutFile, "o", "build.ninja", "the Ninja file to output")
flag.BoolVar(&cmdlineArgs.EmptyNinjaFile, "empty-ninja-file", false, "write out a 0-byte ninja file")
flag.BoolVar(&cmdlineArgs.BazelMode, "bazel-mode", false, "use bazel for analysis of certain modules")
+ flag.BoolVar(&cmdlineArgs.BazelMode, "bazel-mode-staging", false, "use bazel for analysis of certain near-ready modules")
flag.BoolVar(&cmdlineArgs.BazelModeDev, "bazel-mode-dev", false, "use bazel for analysis of a large number of modules (less stable)")
// Flags that probably shouldn't be flags of soong_build but we haven't found
@@ -142,6 +143,8 @@
buildMode = android.BazelDevMode
} else if cmdlineArgs.BazelMode {
buildMode = android.BazelProdMode
+ } else if cmdlineArgs.BazelModeStaging {
+ buildMode = android.BazelStagingMode
} else {
buildMode = android.AnalysisNoBazel
}