Merge "Soong: Add build_error proto raw file to $(OUT_DIR)."
diff --git a/ui/build/paths/config.go b/ui/build/paths/config.go
index e2c5043..d521c7e 100644
--- a/ui/build/paths/config.go
+++ b/ui/build/paths/config.go
@@ -103,7 +103,6 @@
"realpath": Allowed,
"rsync": Allowed,
"sh": Allowed,
- "tar": Allowed,
"tr": Allowed,
"unzip": Allowed,
"zip": Allowed,
@@ -165,6 +164,7 @@
"sort": LinuxOnlyPrebuilt,
"stat": LinuxOnlyPrebuilt,
"tail": LinuxOnlyPrebuilt,
+ "tar": LinuxOnlyPrebuilt,
"tee": LinuxOnlyPrebuilt,
"timeout": LinuxOnlyPrebuilt,
"touch": LinuxOnlyPrebuilt,
diff --git a/ui/terminal/smart_status.go b/ui/terminal/smart_status.go
index 9638cdf..8659d4d 100644
--- a/ui/terminal/smart_status.go
+++ b/ui/terminal/smart_status.go
@@ -225,9 +225,7 @@
// Limit line width to the terminal width, otherwise we'll wrap onto
// another line and we won't delete the previous line.
- if s.termWidth > 0 {
- str = s.elide(str)
- }
+ str = elide(str, s.termWidth)
// Move to the beginning on the line, turn on bold, print the output,
// turn off bold, then clear the rest of the line.
@@ -237,11 +235,11 @@
s.haveBlankLine = false
}
-func (s *smartStatusOutput) elide(str string) string {
- if len(str) > s.termWidth {
+func elide(str string, width int) string {
+ if width > 0 && len(str) > width {
// TODO: Just do a max. Ninja elides the middle, but that's
// more complicated and these lines aren't that important.
- str = str[:s.termWidth]
+ str = str[:width]
}
return str
@@ -344,9 +342,18 @@
desc = runningAction.action.Command
}
- str := fmt.Sprintf(" %2d:%02d %s", seconds/60, seconds%60, desc)
- str = s.elide(str)
- fmt.Fprint(s.writer, str, ansi.clearToEndOfLine())
+ color := ""
+ if seconds >= 60 {
+ color = ansi.red() + ansi.bold()
+ } else if seconds >= 30 {
+ color = ansi.yellow() + ansi.bold()
+ }
+
+ durationStr := fmt.Sprintf(" %2d:%02d ", seconds/60, seconds%60)
+ desc = elide(desc, s.termWidth-len(durationStr))
+ durationStr = color + durationStr + ansi.regular()
+
+ fmt.Fprint(s.writer, durationStr, desc, ansi.clearToEndOfLine())
if tableLine < s.tableHeight-1 {
fmt.Fprint(s.writer, "\n")
}
@@ -387,6 +394,14 @@
return fmt.Sprintf("\x1b[r")
}
+func (ansiImpl) red() string {
+ return "\x1b[31m"
+}
+
+func (ansiImpl) yellow() string {
+ return "\x1b[33m"
+}
+
func (ansiImpl) bold() string {
return "\x1b[1m"
}