mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-16 16:23:15 +00:00
Property to configure the default rolling window size (defaults to 2)
This commit is contained in:

committed by
Peter Palaga

parent
94a2a07058
commit
c8c5d08e1f
@@ -279,6 +279,10 @@ public class DaemonParameters {
|
|||||||
return property(Environment.MVND_NO_BUFERING).orFail().asBoolean();
|
return property(Environment.MVND_NO_BUFERING).orFail().asBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int rollingWindowSize() {
|
||||||
|
return property(Environment.MVND_ROLLING_WINDOW_SIZE).orFail().asInt();
|
||||||
|
}
|
||||||
|
|
||||||
public static String findDefaultMultimoduleProjectDirectory(Path pwd) {
|
public static String findDefaultMultimoduleProjectDirectory(Path pwd) {
|
||||||
Path dir = pwd;
|
Path dir = pwd;
|
||||||
do {
|
do {
|
||||||
|
@@ -63,7 +63,7 @@ public class DefaultClient implements Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DaemonParameters parameters = new DaemonParameters();
|
DaemonParameters parameters = new DaemonParameters();
|
||||||
try (TerminalOutput output = new TerminalOutput(parameters.noBuffering(), logFile)) {
|
try (TerminalOutput output = new TerminalOutput(parameters.noBuffering(), parameters.rollingWindowSize(), logFile)) {
|
||||||
try {
|
try {
|
||||||
new DefaultClient(parameters).execute(output, args);
|
new DefaultClient(parameters).execute(output, args);
|
||||||
} catch (DaemonException.InterruptedException e) {
|
} catch (DaemonException.InterruptedException e) {
|
||||||
|
@@ -64,6 +64,10 @@ public enum Environment {
|
|||||||
* display.
|
* display.
|
||||||
*/
|
*/
|
||||||
MVND_NO_BUFERING("mvnd.noBuffering", null, "false", false),
|
MVND_NO_BUFERING("mvnd.noBuffering", null, "false", false),
|
||||||
|
/**
|
||||||
|
* The size of the rolling window
|
||||||
|
*/
|
||||||
|
MVND_ROLLING_WINDOW_SIZE("mvnd.rollingWindowSize", null, "2", false),
|
||||||
/**
|
/**
|
||||||
* The path to the daemon registry
|
* The path to the daemon registry
|
||||||
*/
|
*/
|
||||||
|
@@ -107,11 +107,12 @@ public class TerminalOutput implements ClientOutput {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TerminalOutput(boolean noBuffering, Path logFile) throws IOException {
|
public TerminalOutput(boolean noBuffering, int rollingWindowSize, Path logFile) throws IOException {
|
||||||
this.start = System.currentTimeMillis();
|
this.start = System.currentTimeMillis();
|
||||||
this.terminal = TerminalBuilder.terminal();
|
this.terminal = TerminalBuilder.terminal();
|
||||||
this.dumb = terminal.getType().startsWith("dumb");
|
this.dumb = terminal.getType().startsWith("dumb");
|
||||||
this.noBuffering = noBuffering;
|
this.noBuffering = noBuffering;
|
||||||
|
this.linesPerProject = rollingWindowSize;
|
||||||
terminal.enterRawMode();
|
terminal.enterRawMode();
|
||||||
Thread mainThread = Thread.currentThread();
|
Thread mainThread = Thread.currentThread();
|
||||||
daemonDispatch = m -> {
|
daemonDispatch = m -> {
|
||||||
|
Reference in New Issue
Block a user