mirror of
https://github.com/apache/maven-mvnd.git
synced 2026-01-13 07:04:14 +08:00
Activate TerminalOutput.noBuffering when -B/--batch-mode is passed via CLI
This commit is contained in:
@@ -49,6 +49,7 @@ public class DefaultClient implements Client {
|
||||
|
||||
Path logFile = null;
|
||||
int i = 0;
|
||||
boolean batchMode = false;
|
||||
while (i < argv.length) {
|
||||
final String arg = argv[i++];
|
||||
if ("-l".equals(arg) || "--log-file".equals(arg)) {
|
||||
@@ -58,12 +59,15 @@ public class DefaultClient implements Client {
|
||||
throw new IllegalArgumentException("-l and --log-file need to be followed by a path");
|
||||
}
|
||||
} else {
|
||||
if (!batchMode && ("-B".equals(arg) || "--batch-mode".equals(arg))) {
|
||||
batchMode = true;
|
||||
}
|
||||
args.add(arg);
|
||||
}
|
||||
}
|
||||
|
||||
DaemonParameters parameters = new DaemonParameters();
|
||||
try (TerminalOutput output = new TerminalOutput(parameters.noBuffering(), parameters.rollingWindowSize(), logFile)) {
|
||||
try (TerminalOutput output = new TerminalOutput(batchMode || parameters.noBuffering(), parameters.rollingWindowSize(), logFile)) {
|
||||
try {
|
||||
new DefaultClient(parameters).execute(output, args);
|
||||
} catch (DaemonException.InterruptedException e) {
|
||||
|
||||
@@ -61,7 +61,7 @@ public enum Environment {
|
||||
MVND_DAEMON_STORAGE("mvnd.daemon.storage", null, null, false),
|
||||
/**
|
||||
* Property that can be set to avoid buffering the output and display events continuously, closer to the usual maven
|
||||
* display.
|
||||
* display. Passing {@code -B} or {@code --batch-mode} on the command line enables this too for the given build.
|
||||
*/
|
||||
MVND_NO_BUFERING("mvnd.noBuffering", null, "false", false),
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ public enum Environment {
|
||||
},
|
||||
/**
|
||||
* The maven builder name to use. Ignored if the user passes
|
||||
*
|
||||
*
|
||||
* @{@code -b} or @{@code --builder} on the command line
|
||||
*/
|
||||
MVND_BUILDER("mvnd.builder", null, "smart", false) {
|
||||
|
||||
Reference in New Issue
Block a user