Various cleanup in soong_ui to aid new feature
- Rename the "BuildX" variables to "RunX"
- Remove redundant comments
- Inline all the "what to do" based on config in build.go
- Inline some constants only used in one place
Bug: 189187214
Test: m nothing
Test: build/soong/build_test.bash
Change-Id: I111a69e642212d7938d4971283545e0d9acbb01a
Merged-In: I111a69e642212d7938d4971283545e0d9acbb01a
(cherry picked from commit d274ea91968b95ef7a2edd2d604afbc237e84ff9)
diff --git a/cmd/multiproduct_kati/main.go b/cmd/multiproduct_kati/main.go
index 20f146a..55a5470 100644
--- a/cmd/multiproduct_kati/main.go
+++ b/cmd/multiproduct_kati/main.go
@@ -460,19 +460,21 @@
}
}()
- buildWhat := build.BuildProductConfig
+ config.SetSkipNinja(true)
+
+ buildWhat := build.RunProductConfig
if !*onlyConfig {
- buildWhat |= build.BuildSoong
+ buildWhat |= build.RunSoong
if !*onlySoong {
- buildWhat |= build.BuildKati
+ buildWhat |= build.RunKati
}
}
before := time.Now()
- build.Build(ctx, config, buildWhat)
+ build.Build(ctx, config)
// Save std_full.log if Kati re-read the makefiles
- if buildWhat&build.BuildKati != 0 {
+ if buildWhat&build.RunKati != 0 {
if after, err := os.Stat(config.KatiBuildNinjaFile()); err == nil && after.ModTime().After(before) {
err := copyFile(stdLog, filepath.Join(filepath.Dir(stdLog), "std_full.log"))
if err != nil {
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go
index 390a9ec..22922c0 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -59,12 +59,10 @@
run func(ctx build.Context, config build.Config, args []string, logsDir string)
}
-const makeModeFlagName = "--make-mode"
-
// list of supported commands (flags) supported by soong ui
var commands []command = []command{
{
- flag: makeModeFlagName,
+ flag: "--make-mode",
description: "build the modules by the target name (i.e. soong_docs)",
config: func(ctx build.Context, args ...string) build.Config {
return build.NewConfig(ctx, args...)
@@ -506,15 +504,7 @@
ctx.Fatal("done")
}
- toBuild := build.BuildAll
- if config.UseBazel() {
- toBuild = build.BuildAllWithBazel
- }
-
- if config.Checkbuild() {
- toBuild |= build.RunBuildTests
- }
- build.Build(ctx, config, toBuild)
+ build.Build(ctx, config)
}
// getCommand finds the appropriate command based on args[1] flag. args[0]