Maven-like rolling output when the build happens to be linear #269

This commit is contained in:
Peter Palaga
2020-12-16 17:50:06 +01:00
parent 803f6ce995
commit f2cdcf9e5f
6 changed files with 918 additions and 124 deletions

View File

@@ -173,6 +173,11 @@ public class TerminalOutput implements ClientOutput {
this.maxThreads = bs.getMaxThreads();
final int maxThreadsDigits = (int) (Math.log10(maxThreads) + 1);
this.threadsFormat = "%" + (maxThreadsDigits * 3 + 2) + "s";
if (maxThreads <= 1 || totalProjects <= 1) {
this.noBuffering = true;
display.update(Collections.emptyList(), 0);
applyNoBuffering();
}
break;
}
case Message.CANCEL_BUILD: {
@@ -322,8 +327,7 @@ public class TerminalOutput implements ClientOutput {
case CTRL_B:
noBuffering = !noBuffering;
if (noBuffering) {
projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
projects.clear();
applyNoBuffering();
} else {
clearDisplay();
}
@@ -345,6 +349,11 @@ public class TerminalOutput implements ClientOutput {
return true;
}
private void applyNoBuffering() {
projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
projects.clear();
}
@Override
public void describeTerminal() {
StringBuilder sb = new StringBuilder();