Revert "Suppress all progress messages from Ninja if ANDROID_QUIET_BUILD is set."
Reverts commit 827aead340
The change being reverted is the result of misunderstanding of how the
status system works. It has to be reverted because it would suppress
_all_ error messages from Make. Achieving what this change purports is
is more involved and requires changing the code to separate progress message
stream from application output stream.
Test: run failing build with ANDROID_QUIET_BUILD=tree and observe errors being output
Change-Id: If9148a7fa773ae32fb0870a448e9470560e53900
This commit is contained in:
@@ -25,27 +25,21 @@ type simpleStatusOutput struct {
|
|||||||
writer io.Writer
|
writer io.Writer
|
||||||
formatter formatter
|
formatter formatter
|
||||||
keepANSI bool
|
keepANSI bool
|
||||||
outputLevel status.MsgLevel
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSimpleStatusOutput returns a StatusOutput that represents the
|
// NewSimpleStatusOutput returns a StatusOutput that represents the
|
||||||
// current build status similarly to Ninja's built-in terminal
|
// current build status similarly to Ninja's built-in terminal
|
||||||
// output.
|
// output.
|
||||||
func NewSimpleStatusOutput(w io.Writer, formatter formatter, keepANSI bool, quietBuild bool) status.StatusOutput {
|
func NewSimpleStatusOutput(w io.Writer, formatter formatter, keepANSI bool) status.StatusOutput {
|
||||||
level := status.StatusLvl
|
|
||||||
if quietBuild {
|
|
||||||
level = status.PrintLvl
|
|
||||||
}
|
|
||||||
return &simpleStatusOutput{
|
return &simpleStatusOutput{
|
||||||
writer: w,
|
writer: w,
|
||||||
formatter: formatter,
|
formatter: formatter,
|
||||||
keepANSI: keepANSI,
|
keepANSI: keepANSI,
|
||||||
outputLevel: level,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *simpleStatusOutput) Message(level status.MsgLevel, message string) {
|
func (s *simpleStatusOutput) Message(level status.MsgLevel, message string) {
|
||||||
if level >= s.outputLevel {
|
if level >= status.StatusLvl {
|
||||||
output := s.formatter.message(level, message)
|
output := s.formatter.message(level, message)
|
||||||
if !s.keepANSI {
|
if !s.keepANSI {
|
||||||
output = string(stripAnsiEscapes([]byte(output)))
|
output = string(stripAnsiEscapes([]byte(output)))
|
||||||
@@ -54,13 +48,10 @@ func (s *simpleStatusOutput) Message(level status.MsgLevel, message string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *simpleStatusOutput) StartAction(_ *status.Action, _ status.Counts) {
|
func (s *simpleStatusOutput) StartAction(action *status.Action, counts status.Counts) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *simpleStatusOutput) FinishAction(result status.ActionResult, counts status.Counts) {
|
func (s *simpleStatusOutput) FinishAction(result status.ActionResult, counts status.Counts) {
|
||||||
if s.outputLevel > status.StatusLvl {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
str := result.Description
|
str := result.Description
|
||||||
if str == "" {
|
if str == "" {
|
||||||
str = result.Command
|
str = result.Command
|
||||||
|
@@ -29,9 +29,9 @@ import (
|
|||||||
func NewStatusOutput(w io.Writer, statusFormat string, forceSimpleOutput, quietBuild, forceKeepANSI bool) status.StatusOutput {
|
func NewStatusOutput(w io.Writer, statusFormat string, forceSimpleOutput, quietBuild, forceKeepANSI bool) status.StatusOutput {
|
||||||
formatter := newFormatter(statusFormat, quietBuild)
|
formatter := newFormatter(statusFormat, quietBuild)
|
||||||
|
|
||||||
if forceSimpleOutput || quietBuild || !isSmartTerminal(w) {
|
if !forceSimpleOutput && isSmartTerminal(w) {
|
||||||
return NewSimpleStatusOutput(w, formatter, forceKeepANSI, quietBuild)
|
|
||||||
} else {
|
|
||||||
return NewSmartStatusOutput(w, formatter)
|
return NewSmartStatusOutput(w, formatter)
|
||||||
|
} else {
|
||||||
|
return NewSimpleStatusOutput(w, formatter, forceKeepANSI)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user