diff options
Diffstat (limited to 'cmd/soong_ui/main.go')
-rw-r--r-- | cmd/soong_ui/main.go | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go index ec4f90e0..974c644a 100644 --- a/cmd/soong_ui/main.go +++ b/cmd/soong_ui/main.go @@ -41,6 +41,12 @@ type command struct { // description for the flag (to display when running help) description string + // Forces the status output into dumb terminal mode. + forceDumbOutput bool + + // Sets a prefix string to use for filenames of log files. + logsPrefix string + // Creates the build configuration based on the args and build context. config func(ctx build.Context, args ...string) build.Config @@ -64,17 +70,21 @@ var commands []command = []command{ stdio: stdio, run: make, }, { - flag: "--dumpvar-mode", - description: "print the value of the legacy make variable VAR to stdout", - config: dumpVarConfig, - stdio: customStdio, - run: dumpVar, + flag: "--dumpvar-mode", + description: "print the value of the legacy make variable VAR to stdout", + forceDumbOutput: true, + logsPrefix: "dumpvars-", + config: dumpVarConfig, + stdio: customStdio, + run: dumpVar, }, { - flag: "--dumpvars-mode", - description: "dump the values of one or more legacy make variables, in shell syntax", - config: dumpVarConfig, - stdio: customStdio, - run: dumpVars, + flag: "--dumpvars-mode", + description: "dump the values of one or more legacy make variables, in shell syntax", + forceDumbOutput: true, + logsPrefix: "dumpvars-", + config: dumpVarConfig, + stdio: customStdio, + run: dumpVars, }, { flag: "--build-mode", description: "build modules based on the specified build action", @@ -113,7 +123,7 @@ func main() { os.Exit(1) } - output := terminal.NewStatusOutput(c.stdio().Stdout(), os.Getenv("NINJA_STATUS"), + output := terminal.NewStatusOutput(c.stdio().Stdout(), os.Getenv("NINJA_STATUS"), c.forceDumbOutput, build.OsEnvironment().IsEnvTrue("ANDROID_QUIET_BUILD")) log := logger.New(output) @@ -157,14 +167,14 @@ func main() { } os.MkdirAll(logsDir, 0777) - log.SetOutput(filepath.Join(logsDir, "soong.log")) - trace.SetOutput(filepath.Join(logsDir, "build.trace")) - stat.AddOutput(status.NewVerboseLog(log, filepath.Join(logsDir, "verbose.log"))) - stat.AddOutput(status.NewErrorLog(log, filepath.Join(logsDir, "error.log"))) - stat.AddOutput(status.NewProtoErrorLog(log, filepath.Join(logsDir, "build_error"))) + log.SetOutput(filepath.Join(logsDir, c.logsPrefix+"soong.log")) + trace.SetOutput(filepath.Join(logsDir, c.logsPrefix+"build.trace")) + stat.AddOutput(status.NewVerboseLog(log, filepath.Join(logsDir, c.logsPrefix+"verbose.log"))) + stat.AddOutput(status.NewErrorLog(log, filepath.Join(logsDir, c.logsPrefix+"error.log"))) + stat.AddOutput(status.NewProtoErrorLog(log, filepath.Join(logsDir, c.logsPrefix+"build_error"))) stat.AddOutput(status.NewCriticalPath(log)) - defer met.Dump(filepath.Join(logsDir, "soong_metrics")) + defer met.Dump(filepath.Join(logsDir, c.logsPrefix+"soong_metrics")) if start, ok := os.LookupEnv("TRACE_BEGIN_SOONG"); ok { if !strings.HasSuffix(start, "N") { |