diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go index e778bd638..aee8e5a49 100644 --- a/cmd/soong_ui/main.go +++ b/cmd/soong_ui/main.go @@ -471,11 +471,9 @@ func make(ctx build.Context, config build.Config, _ []string, logsDir string) { ctx.Fatal("done") } - var toBuild int - if _, ok := config.Environment().Get("USE_BAZEL"); ok { + toBuild := build.BuildAll + if config.UseBazel() { toBuild = build.BuildAllWithBazel - } else { - toBuild = build.BuildAll } if config.Checkbuild() { diff --git a/ui/build/config.go b/ui/build/config.go index e57c7303c..1b98f81f8 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -840,6 +840,16 @@ func (c *configImpl) UseRBE() bool { return false } +func (c *configImpl) UseBazel() bool { + if v, ok := c.environ.Get("USE_BAZEL"); ok { + v = strings.TrimSpace(v) + if v != "" && v != "false" { + return true + } + } + return false +} + func (c *configImpl) StartRBE() bool { if !c.UseRBE() { return false