Add command line flag for extra bazel-built modules
Test: m libcore --bazel-mode-staging --bazel-force-enabled-modules=libcore and find out/bazel/ -name libcore*
Change-Id: I065696d06ce07e05300a41e133867a6e7a891b5e
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index 029bbb4..e7323dd 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -89,6 +89,7 @@
flag.StringVar(&bp2buildMarker, "bp2build_marker", "", "If set, run bp2build, touch the specified marker file then exit")
flag.StringVar(&symlinkForestMarker, "symlink_forest_marker", "", "If set, create the bp2build symlink forest, touch the specified marker file, then exit")
flag.StringVar(&cmdlineArgs.OutFile, "o", "build.ninja", "the Ninja file to output")
+ flag.StringVar(&cmdlineArgs.BazelForceEnabledModules, "bazel-force-enabled-modules", "", "additional modules to build with Bazel. Comma-delimited")
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.BazelModeStaging, "bazel-mode-staging", false, "use bazel for analysis of certain near-ready modules")
@@ -118,6 +119,10 @@
func newConfig(availableEnv map[string]string) android.Config {
var buildMode android.SoongBuildMode
+ var bazelForceEnabledModules []string
+ if len(cmdlineArgs.BazelForceEnabledModules) > 0 {
+ bazelForceEnabledModules = strings.Split(cmdlineArgs.BazelForceEnabledModules, ",")
+ }
if symlinkForestMarker != "" {
buildMode = android.SymlinkForest
@@ -141,7 +146,7 @@
buildMode = android.AnalysisNoBazel
}
- configuration, err := android.NewConfig(cmdlineArgs.ModuleListFile, buildMode, runGoTests, outDir, soongOutDir, availableEnv)
+ configuration, err := android.NewConfig(cmdlineArgs.ModuleListFile, buildMode, runGoTests, outDir, soongOutDir, availableEnv, bazelForceEnabledModules)
if err != nil {
fmt.Fprintf(os.Stderr, "%s", err)
os.Exit(1)