Add build-command arg to soong_ui.
This is a duplicate of aosp/2313558 - this failed due to
a double-commit occurring somewhere in the chain.
Test: m nothing
Test: b build libcore:all
Change-Id: Ie5f1029429fa31170d1051ca3e7fc038ef637702
diff --git a/ui/build/config.go b/ui/build/config.go
index c98601e..b3c4405 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -741,6 +741,12 @@
c.bazelStagingMode = true
} else if arg == "--search-api-dir" {
c.searchApiDir = true
+ } else if strings.HasPrefix(arg, "--build-command=") {
+ buildCmd := strings.TrimPrefix(arg, "--build-command=")
+ // remove quotations
+ buildCmd = strings.TrimPrefix(buildCmd, "\"")
+ buildCmd = strings.TrimSuffix(buildCmd, "\"")
+ ctx.Metrics.SetBuildCommand([]string{buildCmd})
} else if len(arg) > 0 && arg[0] == '-' {
parseArgNum := func(def int) int {
if len(arg) > 2 {