mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-25 21:54:57 +00:00
Fix the "Building null... (0 cores)" displayed at the beginning, at some bold to make it a bit more pretty, #112
This commit is contained in:
@@ -315,11 +315,34 @@ public class TerminalOutput implements ClientOutput {
|
|||||||
pstr = "(progress: " + ((doneProjects * 100) / totalProjects) + "% - " + doneProjects + " out of "
|
pstr = "(progress: " + ((doneProjects * 100) / totalProjects) + "% - " + doneProjects + " out of "
|
||||||
+ totalProjects + " projects)";
|
+ totalProjects + " projects)";
|
||||||
}
|
}
|
||||||
lines.add(new AttributedString(
|
if (name != null) {
|
||||||
"Building " + name + "... (cores: " + usedCores + ")" + dstr + pstr));
|
AttributedStringBuilder asb = new AttributedStringBuilder();
|
||||||
|
asb.append("Building ");
|
||||||
|
asb.style(AttributedStyle.BOLD);
|
||||||
|
asb.append(name);
|
||||||
|
asb.style(AttributedStyle.DEFAULT);
|
||||||
|
asb.append("... (cores: ").append(String.valueOf(usedCores)).append(")")
|
||||||
|
.append(dstr).append(pstr);
|
||||||
|
lines.add(asb.toAttributedString());
|
||||||
|
} else {
|
||||||
|
lines.add(new AttributedString("Building..."));
|
||||||
|
}
|
||||||
int remLogLines = dispLines - projects.size();
|
int remLogLines = dispLines - projects.size();
|
||||||
for (Project prj : projects.values()) {
|
for (Project prj : projects.values()) {
|
||||||
lines.add(AttributedString.fromAnsi(prj.status != null ? prj.status : prj.id + ":<unknown>"));
|
String str = prj.status != null ? prj.status : ":" + prj.id + ":<unknown>";
|
||||||
|
int cs = str.indexOf(':');
|
||||||
|
int ce = cs >= 0 ? str.indexOf(':', cs + 1) : -1;
|
||||||
|
if (ce > 0) {
|
||||||
|
AttributedStringBuilder asb = new AttributedStringBuilder();
|
||||||
|
asb.append(str, 0, cs);
|
||||||
|
asb.style(AttributedStyle.BOLD);
|
||||||
|
asb.append(str, cs, ce);
|
||||||
|
asb.style(AttributedStyle.DEFAULT);
|
||||||
|
asb.append(str, ce, str.length());
|
||||||
|
lines.add(asb.toAttributedString());
|
||||||
|
} else {
|
||||||
|
lines.add(AttributedString.fromAnsi(str));
|
||||||
|
}
|
||||||
// get the last lines of the project log, taking multi-line logs into account
|
// get the last lines of the project log, taking multi-line logs into account
|
||||||
int nb = Math.min(remLogLines, linesPerProject);
|
int nb = Math.min(remLogLines, linesPerProject);
|
||||||
List<AttributedString> logs = lastN(prj.log, nb).stream()
|
List<AttributedString> logs = lastN(prj.log, nb).stream()
|
||||||
|
Reference in New Issue
Block a user