mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-206109 maven build tool window - fix tests
This commit is contained in:
+11
-11
@@ -72,18 +72,18 @@ public class BuildToolWindowMavenConsole extends MavenConsole {
|
||||
@NotNull ExecutionConsole console,
|
||||
@NotNull BuildDescriptor descriptor) {
|
||||
|
||||
return new BuildView(project, console, descriptor, "build.toolwindow.run.selection.state",
|
||||
new ViewManager() {
|
||||
@Override
|
||||
public boolean isConsoleEnabledByDefault() {
|
||||
return true;
|
||||
}
|
||||
return new BuildView(project, console, descriptor, "build.toolwindow.run.selection.state",
|
||||
new ViewManager() {
|
||||
@Override
|
||||
public boolean isConsoleEnabledByDefault() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuildContentView() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public boolean isBuildContentView() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-2
@@ -89,7 +89,6 @@ public class MavenRunConfiguration extends LocatableConfigurationBase implements
|
||||
@Override
|
||||
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) {
|
||||
JavaCommandLineState state = new JavaCommandLineStateImpl(env);
|
||||
state.setConsoleBuilder(MavenConsoleImpl.createConsoleBuilder(getProject()));
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -327,8 +326,9 @@ public class MavenRunConfiguration extends LocatableConfigurationBase implements
|
||||
if (console == null) {
|
||||
return null;
|
||||
}
|
||||
console.attachToProcess(processHandler);
|
||||
|
||||
if (!Registry.is("maven.build.tool.window.enabled")) {
|
||||
console.attachToProcess(processHandler);
|
||||
return console;
|
||||
}
|
||||
else {
|
||||
@@ -341,6 +341,7 @@ public class MavenRunConfiguration extends LocatableConfigurationBase implements
|
||||
MavenBuildEventProcessor eventProcessor =
|
||||
new MavenBuildEventProcessor(getProject(), getProject().getBasePath(), buildView, descriptor, taskId);
|
||||
processHandler.addProcessListener(new BuildToolConsoleProcessAdapter(eventProcessor));
|
||||
buildView.attachToProcess(processHandler);
|
||||
return buildView;
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -216,6 +216,12 @@ public class MavenProjectTaskRunner extends ProjectTaskRunner {
|
||||
AtomicInteger warnings = new AtomicInteger();
|
||||
MavenConsole console = MavenConsole.createGuiMavenConsole(project, title, project.getBasePath());
|
||||
console.addProcessListener(new ProcessAdapter() {
|
||||
|
||||
@Override
|
||||
public void processTerminated(@NotNull ProcessEvent event) {
|
||||
super.processTerminated(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType) {
|
||||
String line = event.getText();
|
||||
|
||||
+5
-5
@@ -101,14 +101,13 @@ public class MavenProjectsProcessor {
|
||||
}
|
||||
|
||||
private void startProcessing(final MavenProjectsProcessorTask task) {
|
||||
MavenConsole console = MavenConsole.createGuiMavenConsole(myProject, "Maven", myProject.getBasePath());
|
||||
MavenUtil.runInBackground(myProject, myTitle, myCancellable, new MavenTask() {
|
||||
@Override
|
||||
public void run(MavenProgressIndicator indicator) throws MavenProcessCanceledException {
|
||||
Condition<MavenProgressIndicator> condition = mavenProgressIndicator -> isStopped;
|
||||
indicator.addCancelCondition(condition);
|
||||
try {
|
||||
doProcessPendingTasks(indicator, task, console);
|
||||
doProcessPendingTasks(indicator, task);
|
||||
}
|
||||
finally {
|
||||
indicator.removeCancelCondition(condition);
|
||||
@@ -118,8 +117,7 @@ public class MavenProjectsProcessor {
|
||||
}
|
||||
|
||||
private void doProcessPendingTasks(MavenProgressIndicator indicator,
|
||||
MavenProjectsProcessorTask task,
|
||||
MavenConsole console)
|
||||
MavenProjectsProcessorTask task)
|
||||
throws MavenProcessCanceledException {
|
||||
int counter = 0;
|
||||
try {
|
||||
@@ -135,7 +133,9 @@ public class MavenProjectsProcessor {
|
||||
|
||||
try {
|
||||
final MavenGeneralSettings mavenGeneralSettings = MavenProjectsManager.getInstance(myProject).getGeneralSettings();
|
||||
task.perform(myProject, myEmbeddersManager, console, indicator);
|
||||
task.perform(myProject, myEmbeddersManager,
|
||||
new SoutMavenConsole(mavenGeneralSettings.getOutputLevel(), mavenGeneralSettings.isPrintErrorStackTraces()),
|
||||
indicator);
|
||||
}
|
||||
catch (MavenProcessCanceledException e) {
|
||||
throw e;
|
||||
|
||||
Reference in New Issue
Block a user