Don't print empty lines to SimpleConsole.
Summary:
If an empty builder is passed to
SimpleConsoleEventBusListener.printLines return rather than printing
an empty line to the console.
Test Plan:
0) buck test --all
1) buckd
2) buck build buck
3) check that no empty lines are printed by 2
diff --git a/src/com/facebook/buck/event/listener/SimpleConsoleEventBusListener.java b/src/com/facebook/buck/event/listener/SimpleConsoleEventBusListener.java
index 13df908..387c996 100644
--- a/src/com/facebook/buck/event/listener/SimpleConsoleEventBusListener.java
+++ b/src/com/facebook/buck/event/listener/SimpleConsoleEventBusListener.java
@@ -117,6 +117,10 @@
// Print through the {@code DirtyPrintStreamDecorator} so printing from the simple console
// is considered to dirty stderr and stdout and so it gets synchronized to avoid interlacing
// output.
- console.getStdErr().println(Joiner.on("\n").join(lines.build()));
+ ImmutableList<String> stringList = lines.build();
+ if (stringList.size() == 0) {
+ return;
+ }
+ console.getStdErr().println(Joiner.on("\n").join(stringList));
}
}