Allow not buffering the output of soong_build .

This behavior is enabled by setting the environment variable
SOONG_UNBUFFERED_OUTPUT=1 .

This is not the default behavior because only one process can be running
in the console pool and this would thus result in a loss of parallelism
if multiple soong_build invocations are needed.

Changing the value of this environment variable does not result in a
rebuild, since it does not affect the build outputs.

Test: Presubmits.
Change-Id: I49d15eb145966bd805f0a47b46866285203b122a
diff --git a/ui/build/soong.go b/ui/build/soong.go
index 5360342..55004fa 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -187,6 +187,11 @@
 		Outputs:     []string{output},
 		Args:        allArgs,
 		Description: description,
+		// NB: Changing the value of this environment variable will not result in a
+		// rebuild. The bootstrap Ninja file will change, but apparently Ninja does
+		// not consider changing the pool specified in a statement a change that's
+		// worth rebuilding for.
+		Console: os.Getenv("SOONG_UNBUFFERED_OUTPUT") == "1",
 	}
 }