diff --git a/platform/external-system-api/resources/messages/ExternalSystemBundle.properties b/platform/external-system-api/resources/messages/ExternalSystemBundle.properties index c20d4c08fc2d..01ebf8f7affd 100644 --- a/platform/external-system-api/resources/messages/ExternalSystemBundle.properties +++ b/platform/external-system-api/resources/messages/ExternalSystemBundle.properties @@ -100,10 +100,8 @@ run.configuration.settings.label.project={0} project: run.configuration.settings.label.tasks=Tasks: run.configuration.settings.label.vmoptions=VM options: run.configuration.settings.label.arguments=Arguments: -run.text.starting.multiple.task={0}: Executing tasks{1}... -run.text.starting.single.task={0}: Executing task{1}... -run.text.ended.multiple.task={0}: Tasks execution finished{1}. -run.text.ended.single.task={0}: Task execution finished{1}. +run.text.starting.task={0}: Executing{1}... +run.text.ended.task={0}: Execution finished{1}. run.invalid.jvm.agent.configuration=Invalid JVM agent configuration used ''{0}'' external.system.java.in.resolving=Resolving... diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java index 5d0de9f36076..5071588974cb 100644 --- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java +++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java @@ -207,8 +207,14 @@ public class ExternalSystemTaskExecutionSettings implements Cloneable { @Override public String toString() { - return StringUtil.join(myTaskNames, " ") + - (StringUtil.isEmpty(myScriptParameters) ? "" : " " + myScriptParameters) + - (StringUtil.isEmpty(myVmOptions) ? "" : " " + myVmOptions); + StringJoiner joiner = new StringJoiner(" "); + myTaskNames.forEach(it -> joiner.add(it)); + if (StringUtil.isNotEmpty(myScriptParameters)) { + joiner.add(myScriptParameters); + } + if (StringUtil.isNotEmpty(myVmOptions)) { + joiner.add(myVmOptions); + } + return joiner.toString(); } } diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunnableState.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunnableState.java index b8543896a5b6..5fab480862ce 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunnableState.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunnableState.java @@ -218,15 +218,10 @@ public class ExternalSystemRunnableState extends UserDataHolderBase implements R ApplicationManager.getApplication().executeOnPooledThread(() -> { final String startDateTime = DateFormatUtil.formatTimeWithSeconds(System.currentTimeMillis()); - final String greeting; - final String settingsDescription = StringUtil.isEmpty(mySettings.toString()) ? "" : String.format(" '%s'", mySettings.toString()); - if (mySettings.getTaskNames().size() > 1) { - greeting = ExternalSystemBundle.message("run.text.starting.multiple.task", startDateTime, settingsDescription) + "\n"; - } - else { - greeting = ExternalSystemBundle.message("run.text.starting.single.task", startDateTime, settingsDescription) + "\n"; - } + final String settingsDescription = StringUtil.isEmpty(mySettings.toString()) ? "" : String.format(" '%s'", mySettings); + final String greeting = ExternalSystemBundle.message("run.text.starting.task", startDateTime, settingsDescription) + "\n"; processHandler.notifyTextAvailable(greeting + "\n", ProcessOutputTypes.SYSTEM); + try (BuildEventDispatcher eventDispatcher = new ExternalSystemEventDispatcher(task.getId(), progressListener, false)) { ExternalSystemTaskNotificationListenerAdapter taskListener = new ExternalSystemTaskNotificationListenerAdapter() { @Override @@ -303,13 +298,7 @@ public class ExternalSystemRunnableState extends UserDataHolderBase implements R @Override public void onEnd(@NotNull ExternalSystemTaskId id) { final String endDateTime = DateFormatUtil.formatTimeWithSeconds(System.currentTimeMillis()); - final String farewell; - if (mySettings.getTaskNames().size() > 1) { - farewell = ExternalSystemBundle.message("run.text.ended.multiple.task", endDateTime, settingsDescription); - } - else { - farewell = ExternalSystemBundle.message("run.text.ended.single.task", endDateTime, settingsDescription); - } + final String farewell = ExternalSystemBundle.message("run.text.ended.task", endDateTime, settingsDescription); processHandler.notifyTextAvailable(farewell + "\n", ProcessOutputTypes.SYSTEM); ExternalSystemRunConfiguration.foldGreetingOrFarewell(consoleView, farewell, false); processHandler.notifyProcessTerminated(0);