Remove the bootstrap.Config class.
It was confusing because bootstrapping uses two configurations: the
"global" config and the special-cased bootstrap one.
This change merges them.
Test: Presubmits.
Change-Id: I82b482cbe28a343ab6991374b2a28667e1a06b48
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index 16a4e1a..7305a6d 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -113,8 +113,8 @@
return ctx
}
-func newConfig(outDir string, availableEnv map[string]string) android.Config {
- configuration, err := android.NewConfig(outDir, cmdlineArgs.ModuleListFile, availableEnv)
+func newConfig(cmdlineArgs bootstrap.Args, outDir string, availableEnv map[string]string) android.Config {
+ configuration, err := android.NewConfig(cmdlineArgs, outDir, availableEnv)
if err != nil {
fmt.Fprintf(os.Stderr, "%s", err)
os.Exit(1)
@@ -140,13 +140,13 @@
os.Exit(1)
}
// Second pass: Full analysis, using the bazel command results. Output ninja file.
- secondConfig, err := android.ConfigForAdditionalRun(configuration)
+ secondArgs = cmdlineArgs
+ secondConfig, err := android.ConfigForAdditionalRun(secondArgs, configuration)
if err != nil {
fmt.Fprintf(os.Stderr, "%s", err)
os.Exit(1)
}
secondCtx := newContext(secondConfig, true)
- secondArgs = cmdlineArgs
ninjaDeps := bootstrap.RunBlueprint(secondArgs, secondCtx.Context, secondConfig)
ninjaDeps = append(ninjaDeps, extraNinjaDeps...)
@@ -298,7 +298,7 @@
availableEnv := parseAvailableEnv()
- configuration := newConfig(outDir, availableEnv)
+ configuration := newConfig(cmdlineArgs, outDir, availableEnv)
extraNinjaDeps := []string{
configuration.ProductVariablesFileName,
usedEnvFile,