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 d274ea9196
)
This commit is contained in:
@@ -59,12 +59,10 @@ type command struct {
|
||||
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 @@ func runMake(ctx build.Context, config build.Config, _ []string, logsDir string)
|
||||
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]
|
||||
|
Reference in New Issue
Block a user