Always display failed and main project at the end (fixes
@@ -32,6 +32,7 @@ import java.util.Deque;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -287,12 +288,18 @@ public class TerminalOutput implements ClientOutput {
case Message.PROJECT_STOPPED: {
StringMessage be = (StringMessage) entry;
final String artifactId = be.getMessage();
- Project prj = projects.remove(artifactId);
+ // Display project log if it has not failed and if it's not the main project
+ if (!Objects.equals(name, artifactId)) {
+ Project prj = projects.get(artifactId);
if (prj != null) {
+ if (failures.stream().noneMatch(e -> Objects.equals(artifactId, e.getProjectId()))) {
+ projects.remove(artifactId);
prj.log.forEach(log);
}
+ }
doneProjects++;
displayDone();
+ }
break;
}
case Message.BUILD_STATUS: {
@@ -300,7 +307,11 @@ public class TerminalOutput implements ClientOutput {
break;
}
case Message.BUILD_FINISHED: {
+ Project main = projects.remove(name);
projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
+ if (main != null) {
+ main.log.forEach(log);
+ }
clearDisplay();
try {
log.close();
