mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-28 08:47:29 +00:00
Provide smarter output on the client, fixes #77
All events are directly forwarded to the client. The client is now responsible for ordering them per project and displaying them if needed. A thread is now started to read the terminal input with support for '+' to display one more line per project, '-' to display one line less, and 'Ctrl+L' to redraw the display which could become messed if the build messages are a bit unusual (this may require a better fix though).
This commit is contained in:
@@ -51,6 +51,11 @@
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@@ -146,9 +146,11 @@ public abstract class Message {
|
||||
}
|
||||
|
||||
public static class BuildMessage extends Message {
|
||||
final String projectId;
|
||||
final String message;
|
||||
|
||||
public BuildMessage(String message) {
|
||||
public BuildMessage(String projectId, String message) {
|
||||
this.projectId = projectId;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@@ -156,6 +158,10 @@ public abstract class Message {
|
||||
return message;
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BuildMessage{" +
|
||||
@@ -236,11 +242,13 @@ public abstract class Message {
|
||||
}
|
||||
|
||||
private BuildMessage readBuildMessage(DataInputStream input) throws IOException {
|
||||
String projectId = readUTF(input);
|
||||
String message = readUTF(input);
|
||||
return new BuildMessage(message);
|
||||
return new BuildMessage(projectId.isEmpty() ? null : projectId, message);
|
||||
}
|
||||
|
||||
private void writeBuildMessage(DataOutputStream output, BuildMessage value) throws IOException {
|
||||
writeUTF(output, value.projectId != null ? value.projectId : "");
|
||||
writeUTF(output, value.message);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user