diff --git a/platform/external-system-api/resources/i18n/ExternalSystemBundle.properties b/platform/external-system-api/resources/i18n/ExternalSystemBundle.properties
index 7cd2a7c64831..b2c613b073da 100644
--- a/platform/external-system-api/resources/i18n/ExternalSystemBundle.properties
+++ b/platform/external-system-api/resources/i18n/ExternalSystemBundle.properties
@@ -32,7 +32,16 @@ tool.window.title.tasks=tasks
# Action.
action.refresh.all.projects.text=Refresh all {0} projects
action.refresh.all.projects.description=Force refresh all linked {0} projects
+action.task.run.text=Run
+action.task.run.description=Run selected task
# Notification
notification.project.refresh.fail.description={0} ''{1}'' project refresh failed:\n{2}
-notification.action.show.settings={0} settings
\ No newline at end of file
+notification.action.show.settings={0} settings
+
+# Execution
+run.configuration.description={0} build
+run.configuration.settings.label.project={0} project:
+run.configuration.settings.label.tasks=Tasks:
+run.configuration.settings.label.vmoptions=VM options:
+run.configuration.settings.caption.vmoptions=VM options:
\ No newline at end of file
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/ExternalSystemManager.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/ExternalSystemManager.java
index 952af8f8be34..3d8294e8fb61 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/ExternalSystemManager.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/ExternalSystemManager.java
@@ -1,7 +1,7 @@
package com.intellij.openapi.externalSystem;
import com.intellij.openapi.extensions.ExtensionPointName;
-import com.intellij.openapi.externalSystem.build.ExternalSystemTaskManager;
+import com.intellij.openapi.externalSystem.task.ExternalSystemTaskManager;
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
import com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings;
import com.intellij.openapi.externalSystem.service.ParametersEnhancer;
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/ExternalSystemUiAware.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/ExternalSystemUiAware.java
index a00badaa9b5e..e503e8314e6e 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/ExternalSystemUiAware.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/ExternalSystemUiAware.java
@@ -15,6 +15,8 @@
*/
package com.intellij.openapi.externalSystem;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
@@ -24,7 +26,13 @@ import javax.swing.*;
* @since 5/15/13 12:37 PM
*/
public interface ExternalSystemUiAware {
-
+
+ @NotNull
+ String getProjectRepresentationName(@NotNull String targetProjectPath, @Nullable String rootProjectPath);
+
+ @Nullable
+ FileChooserDescriptor getExternalProjectConfigDescriptor();
+
@Nullable
Icon getProjectIcon();
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/ProjectSystemId.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/ProjectSystemId.java
index 5b52ddff98b1..e140fc80bafa 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/ProjectSystemId.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/ProjectSystemId.java
@@ -47,6 +47,11 @@ public class ProjectSystemId implements Serializable {
return myId.equals(owner.myId);
}
+ @NotNull
+ public String getId() {
+ return myId;
+ }
+
@NotNull
public String getReadableName() {
return myReadableName;
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/settings/ExternalSystemExecutionSettings.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/settings/ExternalSystemExecutionSettings.java
index d8376e508be5..5c59120ef33d 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/settings/ExternalSystemExecutionSettings.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/settings/ExternalSystemExecutionSettings.java
@@ -3,7 +3,6 @@ package com.intellij.openapi.externalSystem.model.settings;
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener;
import com.intellij.util.SystemProperties;
import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
import java.io.Serializable;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -61,15 +60,6 @@ public class ExternalSystemExecutionSettings implements Serializable {
myVerboseProcessing.set(verboseProcessing);
}
- @Nullable
- public ExternalSystemTaskNotificationListener getNotificationListener() {
- return myNotificationListener.get();
- }
-
- public void setNotificationListener(@NotNull ExternalSystemTaskNotificationListener listener) {
- myNotificationListener.set(listener);
- }
-
@Override
public int hashCode() {
int result = (int)(myRemoteProcessIdleTtlInMs.get() ^ (myRemoteProcessIdleTtlInMs.get() >>> 32));
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/task/ExternalSystemTaskNotificationListener.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/task/ExternalSystemTaskNotificationListener.java
index 8e3c062a1038..3c747fbe4372 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/task/ExternalSystemTaskNotificationListener.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/task/ExternalSystemTaskNotificationListener.java
@@ -36,7 +36,16 @@ public interface ExternalSystemTaskNotificationListener {
* {@link ExternalSystemTaskNotificationEvent#getId() target task}
*/
void onStatusChange(@NotNull ExternalSystemTaskNotificationEvent event);
-
+
+ /**
+ * Notifies about text written to stdout/stderr during the task execution
+ *
+ * @param id id of the task being executed
+ * @param text text produced by external system during the target task execution
+ * @param stdOut flag which identifies output type (stdout or stderr)
+ */
+ void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut);
+
/**
* Notifies that task with the given id is finished.
*
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/task/ExternalSystemTaskNotificationListenerAdapter.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/task/ExternalSystemTaskNotificationListenerAdapter.java
index b9ad865b5344..30978f1fb329 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/task/ExternalSystemTaskNotificationListenerAdapter.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/model/task/ExternalSystemTaskNotificationListenerAdapter.java
@@ -8,6 +8,8 @@ import org.jetbrains.annotations.NotNull;
*/
public abstract class ExternalSystemTaskNotificationListenerAdapter implements ExternalSystemTaskNotificationListener {
+ @NotNull public static final ExternalSystemTaskNotificationListener NULL_OBJECT = new ExternalSystemTaskNotificationListenerAdapter() { };
+
@Override
public void onQueued(@NotNull ExternalSystemTaskId id) {
}
@@ -20,6 +22,10 @@ public abstract class ExternalSystemTaskNotificationListenerAdapter implements E
public void onStatusChange(@NotNull ExternalSystemTaskNotificationEvent event) {
}
+ @Override
+ public void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) {
+ }
+
@Override
public void onEnd(@NotNull ExternalSystemTaskId id) {
}
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/service/project/ExternalSystemProjectResolver.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/service/project/ExternalSystemProjectResolver.java
index 18753d475801..b29b95137c73 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/service/project/ExternalSystemProjectResolver.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/service/project/ExternalSystemProjectResolver.java
@@ -20,6 +20,7 @@ import com.intellij.openapi.externalSystem.model.ExternalSystemException;
import com.intellij.openapi.externalSystem.model.project.ProjectData;
import com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings;
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
+import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -39,6 +40,7 @@ public interface ExternalSystemProjectResolvernull as indication that no specific settings are required
+ * @param listener callback to be notified about the execution
* @return object-level representation of the target external system project;
* null if it's not possible to resolve the project due to the objective reasons
* @throws ExternalSystemException in case when unexpected exception occurs during project info construction
@@ -49,6 +51,7 @@ public interface ExternalSystemProjectResolver resolveProjectInfo(@NotNull ExternalSystemTaskId id,
@NotNull String projectPath,
boolean downloadLibraries,
- @Nullable S settings)
+ @Nullable S settings,
+ @NotNull ExternalSystemTaskNotificationListener listener)
throws ExternalSystemException, IllegalArgumentException, IllegalStateException;
}
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/build/ExternalSystemTaskManager.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/task/ExternalSystemTaskManager.java
similarity index 71%
rename from platform/external-system-api/src/com/intellij/openapi/externalSystem/build/ExternalSystemTaskManager.java
rename to platform/external-system-api/src/com/intellij/openapi/externalSystem/task/ExternalSystemTaskManager.java
index a5e3eb7e6131..a8e04dcb8e6c 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/build/ExternalSystemTaskManager.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/task/ExternalSystemTaskManager.java
@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.intellij.openapi.externalSystem.build;
+package com.intellij.openapi.externalSystem.task;
import com.intellij.openapi.externalSystem.model.ExternalSystemException;
import com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings;
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
+import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -31,6 +32,11 @@ import java.util.List;
*/
public interface ExternalSystemTaskManager {
- void executeTasks(@NotNull ExternalSystemTaskId id, @NotNull List taskNames, @NotNull String projectPath, @Nullable S settings)
+ void executeTasks(@NotNull ExternalSystemTaskId id,
+ @NotNull List taskNames,
+ @NotNull String projectPath,
+ @Nullable S settings,
+ @Nullable String vmOptions,
+ @NotNull ExternalSystemTaskNotificationListener listener)
throws ExternalSystemException;
}
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java
index 222339e7f717..5263f813b18b 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.externalSystem.util;
+import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.diagnostic.Logger;
@@ -52,6 +53,7 @@ import java.util.regex.Pattern;
public class ExternalSystemApiUtil {
private static final Logger LOG = Logger.getInstance("#" + ExternalSystemApiUtil.class.getName());
+ private static final String LAST_USED_PROJECT_PATH_PREFIX = "LAST_EXTERNAL_PROJECT_PATH_";
@NotNull public static final String PATH_SEPARATOR = "/";
@@ -210,21 +212,20 @@ public class ExternalSystemApiUtil {
}
@NotNull
- public static Map>> groupBy(@NotNull Collection> nodes,
- @NotNull Function, K> grouper)
- {
- Map>> result = ContainerUtilRt.newHashMap();
- for (DataNode data : nodes) {
+ public static Map> groupBy(@NotNull Collection nodes, @NotNull Function grouper) {
+ Map> result = ContainerUtilRt.newHashMap();
+ for (V data : nodes) {
K key = grouper.fun(data);
if (key == null) {
LOG.warn(String.format(
"Skipping entry '%s' during grouping. Reason: it's not possible to build a grouping key with grouping strategy '%s'. "
+ "Given entries: %s",
- data, grouper.getClass(), nodes
- ));
+ data,
+ grouper.getClass(),
+ nodes));
continue;
}
- List> grouped = result.get(key);
+ List grouped = result.get(key);
if (grouped == null) {
result.put(key, grouped = ContainerUtilRt.newArrayList());
}
@@ -287,17 +288,12 @@ public class ExternalSystemApiUtil {
return result == null ? Collections.>emptyList() : result;
}
- @NotNull
- public static String toReadableName(@NotNull ProjectSystemId id) {
- return StringUtil.capitalize(id.toString().toLowerCase());
- }
-
public static void executeProjectChangeAction(@NotNull final Runnable task) {
executeProjectChangeAction(false, task);
}
public static void executeProjectChangeAction(boolean synchronous, @NotNull final Runnable task) {
- Runnable wrappedTask = new Runnable() {
+ executeOnEdt(synchronous, new Runnable() {
public void run() {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
@@ -306,18 +302,20 @@ public class ExternalSystemApiUtil {
}
});
}
- };
-
+ });
+ }
+
+ public static void executeOnEdt(boolean synchronous, @NotNull Runnable task) {
if (synchronous) {
if (ApplicationManager.getApplication().isDispatchThread()) {
- wrappedTask.run();
+ task.run();
}
else {
- UIUtil.invokeAndWaitIfNeeded(wrappedTask);
+ UIUtil.invokeAndWaitIfNeeded(task);
}
}
else {
- UIUtil.invokeLaterIfNeeded(wrappedTask);
+ UIUtil.invokeLaterIfNeeded(task);
}
}
@@ -360,4 +358,15 @@ public class ExternalSystemApiUtil {
public static boolean isNewProjectConstruction() {
return ProjectManager.getInstance().getOpenProjects().length == 0;
}
+
+ @NotNull
+ public static String getLastUsedExternalProjectPath(@NotNull ProjectSystemId externalSystemId) {
+ return PropertiesComponent.getInstance().getValue(LAST_USED_PROJECT_PATH_PREFIX + externalSystemId.getReadableName(), "");
+ }
+
+ public static void storeLastUsedExternalProjectPath(@Nullable String path, @NotNull ProjectSystemId externalSystemId) {
+ if (path != null) {
+ PropertiesComponent.getInstance().setValue(LAST_USED_PROJECT_PATH_PREFIX + externalSystemId.getReadableName(), path);
+ }
+ }
}
diff --git a/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemConstants.java b/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemConstants.java
index 1be2f1553b2c..1d7415d46cb3 100644
--- a/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemConstants.java
+++ b/platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemConstants.java
@@ -28,8 +28,10 @@ public class ExternalSystemConstants {
@NonNls @NotNull public static final String LINKED_PROJECT_PATH_KEY = "external.linked.project.path";
@NonNls @NotNull public static final String TOOL_WINDOW_TOOLBAR_ACTIONS_GROUP_ID = "ExternalSystem.ToolWindow.Toolbar";
+ @NonNls @NotNull public static final String TREE_ACTIONS_GROUP_ID = "ExternalSystem.Tree.Context";
@NonNls @NotNull public static final String TOOL_WINDOW_PLACE = "ExternalSystem.ToolWindow";
+ @NonNls @NotNull public static final String TREE_PLACE = "ExternalSystem.Tree";
public static final char PATH_SEPARATOR = '/';
@@ -37,4 +39,6 @@ public class ExternalSystemConstants {
public static final int BUILTIN_SERVICE_ORDER = 42;
public static final int BUILTIN_TOOL_WINDOW_SERVICE_ORDER = 62;
public static final int UNORDERED = 1000;
+
+ public static final int TEXT_FIELD_WIDTH_IN_COLUMNS = 20;
}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/AbstractExternalTaskAction.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/AbstractExternalTaskAction.java
new file mode 100644
index 000000000000..027c1d464147
--- /dev/null
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/AbstractExternalTaskAction.java
@@ -0,0 +1,100 @@
+package com.intellij.openapi.externalSystem.action;
+
+import com.intellij.execution.ui.ConsoleViewContentType;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.PlatformDataKeys;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.externalSystem.ExternalSystemManager;
+import com.intellij.openapi.externalSystem.model.ExternalSystemDataKeys;
+import com.intellij.openapi.externalSystem.model.ProjectSystemId;
+import com.intellij.openapi.externalSystem.model.serialization.ExternalTaskPojo;
+import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
+import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListenerAdapter;
+import com.intellij.openapi.externalSystem.service.internal.ExternalSystemExecuteTaskTask;
+import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
+import com.intellij.openapi.externalSystem.util.ExternalSystemUtil;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.project.Project;
+import com.intellij.util.containers.ContainerUtilRt;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Denis Zhdanov
+ * @since 22.05.13 13:04
+ */
+public abstract class AbstractExternalTaskAction extends AnAction implements DumbAware {
+
+ @Override
+ public void update(AnActionEvent e) {
+ e.getPresentation().setVisible(getSelectedTask(e.getDataContext()) != null);
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
+ if (project == null) {
+ return;
+ }
+
+ ProjectSystemId externalSystemId = ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID.getData(e.getDataContext());
+ if (externalSystemId == null) {
+ return;
+ }
+
+ ExternalTaskPojo taskPojo = getSelectedTask(e.getDataContext(), externalSystemId);
+ if (taskPojo == null) {
+ return;
+ }
+
+ ExternalSystemManager,?,?,?,?> manager = ExternalSystemApiUtil.getManager(externalSystemId);
+ if (manager == null) {
+ return;
+ }
+
+ final ExternalSystemExecuteTaskTask task
+ = new ExternalSystemExecuteTaskTask(externalSystemId, project, ContainerUtilRt.newArrayList(taskPojo), getVmOptions());
+ final boolean interestedInTaskOutput = prepareForOutput();
+ ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
+ @Override
+ public void run() {
+ if (interestedInTaskOutput) {
+ task.execute(new ExternalSystemTaskNotificationListenerAdapter() {
+ @Override
+ public void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) {
+ onOutput(text, stdOut ? ConsoleViewContentType.NORMAL_OUTPUT : ConsoleViewContentType.ERROR_OUTPUT);
+ }
+ });
+ }
+ else {
+ task.execute();
+ }
+ }
+ });
+ }
+
+ @Nullable
+ protected abstract String getVmOptions();
+
+ // TODO den add doc
+ protected abstract boolean prepareForOutput();
+
+ protected abstract void onOutput(@NotNull String text, @NotNull ConsoleViewContentType type);
+
+ @Nullable
+ private static ExternalTaskPojo getSelectedTask(@NotNull DataContext dataContext) {
+ return getSelectedTask(dataContext, ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID.getData(dataContext));
+ }
+
+ private static ExternalTaskPojo getSelectedTask(@NotNull DataContext dataContext, @Nullable ProjectSystemId externalSystemId) {
+ if (externalSystemId == null) {
+ return null;
+ }
+ return ExternalSystemUtil.getToolWindowElement(ExternalTaskPojo.class,
+ dataContext,
+ ExternalSystemDataKeys.SELECTED_TASK,
+ externalSystemId);
+ }
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RunExternalTaskAction.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RunExternalTaskAction.java
new file mode 100644
index 000000000000..23ecb8fce188
--- /dev/null
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RunExternalTaskAction.java
@@ -0,0 +1,36 @@
+package com.intellij.openapi.externalSystem.action;
+
+import com.intellij.execution.ui.ConsoleViewContentType;
+import com.intellij.openapi.externalSystem.util.ExternalSystemBundle;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Denis Zhdanov
+ * @since 22.05.13 12:57
+ */
+public class RunExternalTaskAction extends AbstractExternalTaskAction {
+
+ public RunExternalTaskAction() {
+ getTemplatePresentation().setText(ExternalSystemBundle.message("action.task.run.text"));
+ getTemplatePresentation().setDescription(ExternalSystemBundle.message("action.task.run.description"));
+ }
+
+ @Nullable
+ @Override
+ protected String getVmOptions() {
+ return null;
+ }
+
+ @Override
+ protected boolean prepareForOutput() {
+ //RunnerAndConfigurationSettings settings = new RunnerAndConfigurationSettingsImpl();
+ return true;
+ }
+
+ @Override
+ protected void onOutput(@NotNull String text, @NotNull ConsoleViewContentType type) {
+ // TODO den remove
+ System.out.print(text);
+ }
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/model/ExternalSystemDataKeys.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/model/ExternalSystemDataKeys.java
index 6f185872c109..0f79532fd9e7 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/model/ExternalSystemDataKeys.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/model/ExternalSystemDataKeys.java
@@ -17,6 +17,7 @@ package com.intellij.openapi.externalSystem.model;
import com.intellij.notification.NotificationGroup;
import com.intellij.openapi.actionSystem.DataKey;
+import com.intellij.openapi.externalSystem.model.serialization.ExternalTaskPojo;
import com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTreeModel;
import org.jetbrains.annotations.NotNull;
@@ -29,6 +30,7 @@ public class ExternalSystemDataKeys {
@NotNull public static final DataKey EXTERNAL_SYSTEM_ID = DataKey.create("external.system.id");
@NotNull public static final DataKey NOTIFICATION_GROUP = DataKey.create("external.system.notification");
@NotNull public static final DataKey ALL_TASKS_MODEL = DataKey.create("external.system.all.tasks.model");
+ @NotNull public static final DataKey SELECTED_TASK = DataKey.create("external.system.selected.task");
private ExternalSystemDataKeys() {
}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java
new file mode 100644
index 000000000000..66b3ef91ffac
--- /dev/null
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/model/execution/ExternalSystemTaskExecutionSettings.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.openapi.externalSystem.model.execution;
+
+import com.intellij.openapi.externalSystem.model.ProjectSystemId;
+import com.intellij.util.containers.ContainerUtilRt;
+import com.intellij.util.xmlb.annotations.Tag;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+/**
+ * @author Denis Zhdanov
+ * @since 24.05.13 12:20
+ */
+@Tag("ExternalSystemSettings")
+public class ExternalSystemTaskExecutionSettings implements Cloneable {
+
+ @NotNull @NonNls public static final String TAG_NAME = "ExternalSystemSettings";
+
+ private List myTaskNames = ContainerUtilRt.newArrayList();
+
+ private String myExternalSystemIdString;
+ private String myExternalProjectPath;
+ private String myVmOptions;
+
+ public String getExternalSystemIdString() {
+ return myExternalSystemIdString;
+ }
+
+ public ProjectSystemId getExternalSystemId() {
+ return new ProjectSystemId(myExternalSystemIdString);
+ }
+
+ public void setExternalSystemIdString(String externalSystemIdString) {
+ myExternalSystemIdString = externalSystemIdString;
+ }
+
+ public String getExternalProjectPath() {
+ return myExternalProjectPath;
+ }
+
+ public void setExternalProjectPath(String externalProjectPath) {
+ myExternalProjectPath = externalProjectPath;
+ }
+
+ public String getVmOptions() {
+ return myVmOptions;
+ }
+
+ public void setVmOptions(String vmOptions) {
+ myVmOptions = vmOptions;
+ }
+
+ public List getTaskNames() {
+ return myTaskNames;
+ }
+
+ public void setTaskNames(List taskNames) {
+ myTaskNames.clear();
+ myTaskNames.addAll(taskNames);
+ }
+
+ @Override
+ public ExternalSystemTaskExecutionSettings clone() {
+ ExternalSystemTaskExecutionSettings result = new ExternalSystemTaskExecutionSettings();
+ result.setExternalSystemIdString(getExternalSystemIdString());
+ result.setExternalProjectPath(getExternalProjectPath());
+ result.setVmOptions(getVmOptions());
+ result.setTaskNames(ContainerUtilRt.newArrayList(getTaskNames()));
+ return result;
+ }
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeImpl.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeImpl.java
index bacd1722fdd3..050dff9b9faa 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeImpl.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeImpl.java
@@ -1,14 +1,11 @@
package com.intellij.openapi.externalSystem.service;
import com.intellij.execution.rmi.RemoteServer;
-import com.intellij.openapi.externalSystem.build.ExternalSystemTaskManager;
+import com.intellij.openapi.externalSystem.task.ExternalSystemTaskManager;
import com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings;
-import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
-import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationEvent;
-import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType;
+import com.intellij.openapi.externalSystem.model.task.*;
import com.intellij.openapi.externalSystem.service.project.ExternalSystemProjectResolver;
import com.intellij.openapi.externalSystem.service.remote.*;
-import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener;
import com.intellij.util.Alarm;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.ContainerUtilRt;
@@ -43,8 +40,8 @@ public class ExternalSystemFacadeImpl
private final Alarm myShutdownAlarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
private final AtomicInteger myCallsInProgressNumber = new AtomicInteger();
- private final AtomicReference myNotificationListener
- = new AtomicReference();
+ private final AtomicReference myNotificationListener =
+ new AtomicReference(new ExternalSystemTaskNotificationListenerAdapter() {});
@NotNull private final RemoteExternalSystemProjectResolverImpl myProjectResolver;
@NotNull private final RemoteExternalSystemTaskManagerImpl myTaskManager;
@@ -62,15 +59,14 @@ public class ExternalSystemFacadeImpl
public static void main(String[] args) throws Exception {
if (args.length < 1) {
throw new IllegalArgumentException(
- "Can't create external system facade. Reason: given arguments don't contain information about external system resolver to use"
- );
+ "Can't create external system facade. Reason: given arguments don't contain information about external system resolver to use");
}
final Class> resolverClass = (Class>)Class.forName(args[0]);
if (!ExternalSystemProjectResolver.class.isAssignableFrom(resolverClass)) {
throw new IllegalArgumentException(String.format(
"Can't create external system facade. Reason: given external system resolver class (%s) must be IS-A '%s'",
- resolverClass, ExternalSystemProjectResolver.class
- ));
+ resolverClass,
+ ExternalSystemProjectResolver.class));
}
if (args.length < 2) {
@@ -292,6 +288,16 @@ public class ExternalSystemFacadeImpl
}
}
+ @Override
+ public void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) {
+ try {
+ myManager.onTaskOutput(id, text, stdOut);
+ }
+ catch (RemoteException e) {
+ // Ignore
+ }
+ }
+
@Override
public void onEnd(@NotNull ExternalSystemTaskId id) {
try {
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeManager.java
index 32ea5f65464c..23fc785c76bb 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeManager.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ExternalSystemFacadeManager.java
@@ -186,8 +186,8 @@ public class ExternalSystemFacadeManager {
return params;
}
- @NotNull
@Override
+ @NotNull
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
ProcessHandler processHandler = startProcess();
return new DefaultExecutionResult(null, processHandler, AnAction.EMPTY_ARRAY);
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/AbstractExternalSystemTaskConfigurationType.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/AbstractExternalSystemTaskConfigurationType.java
new file mode 100644
index 000000000000..a6538f8a8dba
--- /dev/null
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/AbstractExternalSystemTaskConfigurationType.java
@@ -0,0 +1,86 @@
+package com.intellij.openapi.externalSystem.service.execution;
+
+import com.intellij.execution.configurations.ConfigurationFactory;
+import com.intellij.execution.configurations.ConfigurationType;
+import com.intellij.execution.configurations.RunConfiguration;
+import com.intellij.openapi.externalSystem.ExternalSystemManager;
+import com.intellij.openapi.externalSystem.ExternalSystemUiAware;
+import com.intellij.openapi.externalSystem.model.ProjectSystemId;
+import com.intellij.openapi.externalSystem.service.ui.DefaultExternalSystemUiAware;
+import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
+import com.intellij.openapi.externalSystem.util.ExternalSystemBundle;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.NotNullLazyValue;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+/**
+ * // TODO den add doc
+ *
+ * @author Denis Zhdanov
+ * @since 23.05.13 17:43
+ */
+public abstract class AbstractExternalSystemTaskConfigurationType implements ConfigurationType {
+
+ @NotNull private final ProjectSystemId myExternalSystemId;
+ @NotNull private final ConfigurationFactory[] myFactories = new ConfigurationFactory[1];
+
+ @NotNull private final NotNullLazyValue myIcon = new NotNullLazyValue() {
+ @NotNull
+ @Override
+ protected Icon compute() {
+ ExternalSystemManager, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(myExternalSystemId);
+ Icon result = null;
+ if (manager instanceof ExternalSystemUiAware) {
+ result = ((ExternalSystemUiAware)manager).getProjectIcon();
+ }
+ return result == null ? DefaultExternalSystemUiAware.INSTANCE.getTaskIcon() : result;
+ }
+ };
+
+ protected AbstractExternalSystemTaskConfigurationType(@NotNull final ProjectSystemId externalSystemId) {
+ myExternalSystemId = externalSystemId;
+ myFactories[0] = new ConfigurationFactory(this) {
+ @Override
+ public RunConfiguration createTemplateConfiguration(Project project) {
+ return doCreateConfiguration(myExternalSystemId, project, this, "");
+ }
+ };
+ }
+
+ @NotNull
+ protected ExternalSystemRunConfiguration doCreateConfiguration(@NotNull ProjectSystemId externalSystemId,
+ @NotNull Project project,
+ @NotNull ConfigurationFactory factory,
+ @NotNull String name)
+ {
+ return new ExternalSystemRunConfiguration(externalSystemId, project, factory, name);
+ }
+
+ @Override
+ public String getDisplayName() {
+ return myExternalSystemId.getReadableName();
+ }
+
+ @Override
+ public String getConfigurationTypeDescription() {
+ return ExternalSystemBundle.message("run.configuration.description", myExternalSystemId.getReadableName());
+ }
+
+ @Override
+ public Icon getIcon() {
+ return myIcon.getValue();
+ }
+
+ @NotNull
+ @Override
+ public String getId() {
+ return myExternalSystemId.getReadableName() + "RunConfiguration";
+ }
+
+ @Override
+ public ConfigurationFactory[] getConfigurationFactories() {
+ return myFactories;
+ }
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunConfiguration.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunConfiguration.java
new file mode 100644
index 000000000000..6401d55a4447
--- /dev/null
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunConfiguration.java
@@ -0,0 +1,169 @@
+package com.intellij.openapi.externalSystem.service.execution;
+
+import com.intellij.execution.DefaultExecutionResult;
+import com.intellij.execution.ExecutionException;
+import com.intellij.execution.ExecutionResult;
+import com.intellij.execution.Executor;
+import com.intellij.execution.configurations.*;
+import com.intellij.execution.filters.TextConsoleBuilderImpl;
+import com.intellij.execution.process.ProcessHandler;
+import com.intellij.execution.process.ProcessOutputTypes;
+import com.intellij.execution.runners.ExecutionEnvironment;
+import com.intellij.execution.runners.ProgramRunner;
+import com.intellij.execution.ui.ConsoleView;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.externalSystem.model.ProjectSystemId;
+import com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings;
+import com.intellij.openapi.externalSystem.model.serialization.ExternalTaskPojo;
+import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
+import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListenerAdapter;
+import com.intellij.openapi.externalSystem.service.internal.ExternalSystemExecuteTaskTask;
+import com.intellij.openapi.options.SettingsEditor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.InvalidDataException;
+import com.intellij.openapi.util.JDOMExternalizable;
+import com.intellij.openapi.util.WriteExternalException;
+import com.intellij.util.containers.ContainerUtilRt;
+import com.intellij.util.xmlb.XmlSerializer;
+import org.jdom.Element;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.OutputStream;
+import java.util.List;
+
+/**
+ * @author Denis Zhdanov
+ * @since 23.05.13 18:30
+ */
+public class ExternalSystemRunConfiguration extends RunConfigurationBase {
+
+ private ExternalSystemTaskExecutionSettings mySettings = new ExternalSystemTaskExecutionSettings();
+
+ public ExternalSystemRunConfiguration(@NotNull ProjectSystemId externalSystemId,
+ Project project,
+ ConfigurationFactory factory,
+ String name)
+ {
+ super(project, factory, name);
+ mySettings.setExternalSystemIdString(externalSystemId.getId());
+ }
+
+ @Override
+ public RunConfiguration clone() {
+ ExternalSystemRunConfiguration result = (ExternalSystemRunConfiguration)super.clone();
+ result.mySettings = mySettings.clone();
+ return result;
+ }
+
+ @Override
+ public void readExternal(Element element) throws InvalidDataException {
+ super.readExternal(element);
+ Element e = element.getChild(ExternalSystemTaskExecutionSettings.TAG_NAME);
+ if (e != null) {
+ mySettings = XmlSerializer.deserialize(e, ExternalSystemTaskExecutionSettings.class);
+ }
+ }
+
+ @Override
+ public void writeExternal(Element element) throws WriteExternalException {
+ super.writeExternal(element);
+ element.addContent(XmlSerializer.serialize(mySettings));
+ }
+
+ @NotNull
+ public ExternalSystemTaskExecutionSettings getSettings() {
+ return mySettings;
+ }
+
+ @Override
+ public SettingsEditor extends RunConfiguration> getConfigurationEditor() {
+ return new ExternalSystemRunConfigurationEditor(getProject(), mySettings.getExternalSystemId());
+ }
+
+ @Nullable
+ @Override
+ public JDOMExternalizable createRunnerSettings(ConfigurationInfoProvider provider) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Nullable
+ @Override
+ public SettingsEditor getRunnerSettingsEditor(ProgramRunner runner) {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Nullable
+ @Override
+ public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) throws ExecutionException {
+ return new RunnableState() {
+ @Nullable
+ @Override
+ public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
+ ConsoleView console = new TextConsoleBuilderImpl(getProject()).getConsole();
+ final ProcessHandler processHandler = new ProcessHandler() {
+ @Override
+ protected void destroyProcessImpl() {
+ }
+
+ @Override
+ protected void detachProcessImpl() {
+ notifyProcessDetached();
+ }
+
+ @Override
+ public boolean detachIsDefault() {
+ return true;
+ }
+
+ @Nullable
+ @Override
+ public OutputStream getProcessInput() {
+ return null;
+ }
+ };
+ console.attachToProcess(processHandler);
+ List tasks = ContainerUtilRt.newArrayList();
+ for (String taskName : mySettings.getTaskNames()) {
+ tasks.add(new ExternalTaskPojo(taskName, mySettings.getExternalProjectPath(), null));
+ }
+ final ExternalSystemExecuteTaskTask task = new ExternalSystemExecuteTaskTask(mySettings.getExternalSystemId(),
+ getProject(),
+ tasks,
+ mySettings.getVmOptions());
+ ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
+ @Override
+ public void run() {
+ task.execute(new ExternalSystemTaskNotificationListenerAdapter() {
+ @Override
+ public void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) {
+ processHandler.notifyTextAvailable(text, stdOut ? ProcessOutputTypes.STDOUT : ProcessOutputTypes.STDERR);
+ }
+
+ @Override
+ public void onEnd(@NotNull ExternalSystemTaskId id) {
+ processHandler.destroyProcess();
+ }
+ });
+ }
+ });
+ return new DefaultExecutionResult(console, processHandler);
+ }
+
+ @Override
+ public RunnerSettings getRunnerSettings() {
+ return null;
+ }
+
+ @Override
+ public ConfigurationPerRunnerSettings getConfigurationSettings() {
+ return null;
+ }
+ };
+ }
+
+ @Override
+ public void checkConfiguration() throws RuntimeConfigurationException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunConfigurationEditor.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunConfigurationEditor.java
new file mode 100644
index 000000000000..7769c9011482
--- /dev/null
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemRunConfigurationEditor.java
@@ -0,0 +1,48 @@
+package com.intellij.openapi.externalSystem.service.execution;
+
+import com.intellij.openapi.externalSystem.model.ProjectSystemId;
+import com.intellij.openapi.externalSystem.util.PaintAwarePanel;
+import com.intellij.openapi.options.ConfigurationException;
+import com.intellij.openapi.options.SettingsEditor;
+import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+import java.awt.*;
+
+/**
+ * @author Denis Zhdanov
+ * @since 23.05.13 18:34
+ */
+public class ExternalSystemRunConfigurationEditor extends SettingsEditor {
+
+ @NotNull private final ExternalSystemTaskSettingsControl myControl;
+
+ public ExternalSystemRunConfigurationEditor(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
+ myControl = new ExternalSystemTaskSettingsControl(project, externalSystemId);
+ }
+
+ @Override
+ protected void resetEditorFrom(ExternalSystemRunConfiguration s) {
+ myControl.setOriginalSettings(s.getSettings());
+ myControl.reset();
+ }
+
+ @Override
+ protected void applyEditorTo(ExternalSystemRunConfiguration s) throws ConfigurationException {
+ myControl.apply(s.getSettings());
+ }
+
+ @NotNull
+ @Override
+ protected JComponent createEditor() {
+ PaintAwarePanel result = new PaintAwarePanel(new GridBagLayout());
+ myControl.fillUi(result, 0);
+ return result;
+ }
+
+ @Override
+ protected void disposeEditor() {
+ myControl.disposeUIResources();
+ }
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskRunner.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskRunner.java
new file mode 100644
index 000000000000..1c8dfab2074f
--- /dev/null
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskRunner.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.openapi.externalSystem.service.execution;
+
+import com.intellij.execution.ExecutionException;
+import com.intellij.execution.ExecutionResult;
+import com.intellij.execution.Executor;
+import com.intellij.execution.configurations.RunProfile;
+import com.intellij.execution.configurations.RunProfileState;
+import com.intellij.execution.executors.DefaultRunExecutor;
+import com.intellij.execution.runners.ExecutionEnvironment;
+import com.intellij.execution.runners.GenericProgramRunner;
+import com.intellij.execution.runners.RunContentBuilder;
+import com.intellij.execution.ui.RunContentDescriptor;
+import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Denis Zhdanov
+ * @since 5/26/13 11:20 PM
+ */
+public class ExternalSystemTaskRunner extends GenericProgramRunner {
+
+ @NotNull
+ @Override
+ public String getRunnerId() {
+ return "ExternalSystemTaskRunner";
+ }
+
+ @Override
+ public boolean canRun(@NotNull String executorId, @NotNull RunProfile profile) {
+ return DefaultRunExecutor.EXECUTOR_ID.equals(executorId) && profile instanceof ExternalSystemRunConfiguration;
+ }
+
+ @Nullable
+ @Override
+ protected RunContentDescriptor doExecute(Project project,
+ Executor executor,
+ RunProfileState state,
+ RunContentDescriptor contentToReuse,
+ ExecutionEnvironment env) throws ExecutionException
+ {
+ ExecutionResult executionResult = state.execute(executor, this);
+ if (executionResult == null) return null;
+
+ final RunContentBuilder contentBuilder = new RunContentBuilder(project, this, executor, executionResult, env);
+ return contentBuilder.showRunContent(contentToReuse);
+ }
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskSettingsControl.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskSettingsControl.java
new file mode 100644
index 000000000000..c36d1a623711
--- /dev/null
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/execution/ExternalSystemTaskSettingsControl.java
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.openapi.externalSystem.service.execution;
+
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.externalSystem.ExternalSystemManager;
+import com.intellij.openapi.externalSystem.ExternalSystemUiAware;
+import com.intellij.openapi.externalSystem.model.ProjectSystemId;
+import com.intellij.openapi.externalSystem.model.execution.ExternalSystemTaskExecutionSettings;
+import com.intellij.openapi.externalSystem.service.ui.ExternalProjectPathField;
+import com.intellij.openapi.externalSystem.util.*;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.ui.RawCommandLineEditor;
+import com.intellij.ui.components.JBLabel;
+import com.intellij.ui.components.JBTextField;
+import com.intellij.util.Consumer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.awt.*;
+
+import static com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.normalizePath;
+
+/**
+ * @author Denis Zhdanov
+ * @since 23.05.13 18:46
+ */
+public class ExternalSystemTaskSettingsControl implements ExternalSystemSettingsControl {
+
+ @NotNull private final ProjectSystemId myExternalSystemId;
+ @NotNull private final Project myProject;
+
+ @SuppressWarnings("FieldCanBeLocal") // Used via reflection at showUi() and disposeResources()
+ private JBLabel myProjectPathLabel;
+ private ExternalProjectPathField myProjectPathField;
+ @SuppressWarnings("FieldCanBeLocal") // Used via reflection at showUi() and disposeResources()
+ private JBLabel myTasksLabel;
+ private JBTextField myTasksTextField;
+ @SuppressWarnings("FieldCanBeLocal") // Used via reflection at showUi() and disposeResources()
+ private JBLabel myVmOptionsLabel;
+ private RawCommandLineEditor myVmOptionsEditor;
+
+ @Nullable private ExternalSystemTaskExecutionSettings myOriginalSettings;
+
+ public ExternalSystemTaskSettingsControl(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
+ myProject = project;
+ myExternalSystemId = externalSystemId;
+ }
+
+ public void setOriginalSettings(@Nullable ExternalSystemTaskExecutionSettings originalSettings) {
+ myOriginalSettings = originalSettings;
+ }
+
+ @Override
+ public void fillUi(@NotNull final PaintAwarePanel canvas, int indentLevel) {
+ myProjectPathLabel =
+ new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.project", myExternalSystemId.getReadableName()));
+ ExternalSystemManager, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(myExternalSystemId);
+ FileChooserDescriptor projectPathChooserDescriptor = null;
+ if (manager instanceof ExternalSystemUiAware) {
+ projectPathChooserDescriptor = ((ExternalSystemUiAware)manager).getExternalProjectConfigDescriptor();
+ }
+ if (projectPathChooserDescriptor == null) {
+ projectPathChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
+ }
+ String title = ExternalSystemBundle.message("settings.label.select.project", myExternalSystemId.getReadableName());
+ myProjectPathField = new ExternalProjectPathField(myProject, myExternalSystemId, projectPathChooserDescriptor, title) {
+ @Override
+ public Dimension getPreferredSize() {
+ return myVmOptionsEditor == null ? super.getPreferredSize() : myVmOptionsEditor.getTextField().getPreferredSize();
+ }
+ };
+ canvas.add(myProjectPathLabel, ExternalSystemUiUtil.getLabelConstraints(0));
+ canvas.add(myProjectPathField, ExternalSystemUiUtil.getFillLineConstraints(0));
+
+ myTasksLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.tasks"));
+ myTasksTextField = new JBTextField(ExternalSystemConstants.TEXT_FIELD_WIDTH_IN_COLUMNS);
+ canvas.add(myTasksLabel, ExternalSystemUiUtil.getLabelConstraints(0));
+ canvas.add(myTasksTextField, ExternalSystemUiUtil.getFillLineConstraints(0));
+
+ myVmOptionsLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.vmoptions"));
+ myVmOptionsEditor = new RawCommandLineEditor();
+ myVmOptionsEditor.setDialogCaption(ExternalSystemBundle.message("run.configuration.settings.caption.vmoptions"));
+ canvas.add(myVmOptionsLabel, ExternalSystemUiUtil.getLabelConstraints(0));
+ canvas.add(myVmOptionsEditor, ExternalSystemUiUtil.getFillLineConstraints(0));
+
+ canvas.setPaintCallback(new Consumer() {
+
+ @Nullable private Dimension myDimension;
+ @Nullable private Dimension myBounds;
+ private boolean myBorderReset;
+
+ @Override
+ public void consume(Graphics graphics) {
+ if (!myBorderReset) {
+ Editor editor = myProjectPathField.getChildComponent().getEditor();
+ if (editor != null) {
+ myBorderReset = true;
+ editor.setBorder(null);
+ }
+ }
+ Dimension size = myVmOptionsEditor.getTextField().getPreferredSize();
+ Rectangle bounds = myVmOptionsEditor.getTextField().getBounds();
+ if (!size.equals(myDimension)) {
+ myDimension = size;
+ }
+ if (myBounds == null || myBounds.width != bounds.width || myBounds.height == bounds.height) {
+ myBounds = bounds.getSize();
+ }
+
+ applyDimension(myProjectPathField.getChildComponent(), false);
+ applyDimension(myTasksTextField, true);
+ }
+
+ private void applyDimension(@NotNull JComponent component, boolean processBounds) {
+ Rectangle bounds = component.getBounds();
+ if (bounds != null && myBounds != null && (bounds.width != myBounds.width || bounds.height != myBounds.height)) {
+ component.setPreferredSize(myDimension);
+ if (processBounds) {
+ component.setBounds(bounds.x, bounds.y, myBounds.width, myBounds.height);
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public void reset() {
+ myProjectPathField.setText("");
+ myTasksTextField.setText("");
+ myVmOptionsEditor.setText("");
+ showUi(true);
+
+ if (myOriginalSettings == null) {
+ return;
+ }
+
+ String path = myOriginalSettings.getExternalProjectPath();
+ if (StringUtil.isEmpty(path)) {
+ path = ExternalSystemApiUtil.getLastUsedExternalProjectPath(myExternalSystemId);
+ }
+ myProjectPathField.setText(path);
+ myTasksTextField.setText(StringUtil.join(myOriginalSettings.getTaskNames(), " "));
+ myVmOptionsEditor.setText(myOriginalSettings.getVmOptions());
+ }
+
+ @Override
+ public boolean isModified() {
+ if (myOriginalSettings == null) {
+ return false;
+ }
+
+ return !Comparing.equal(normalizePath(myProjectPathField.getText()),
+ normalizePath(myOriginalSettings.getExternalProjectPath()))
+ || !Comparing.equal(normalizePath(myTasksTextField.getText()),
+ normalizePath(StringUtil.join(myOriginalSettings.getTaskNames(), " ")))
+ || !Comparing.equal(normalizePath(myVmOptionsEditor.getText()),
+ normalizePath(myOriginalSettings.getVmOptions()));
+ }
+
+ @Nullable
+ @Override
+ public String apply(@NotNull ExternalSystemTaskExecutionSettings settings) {
+ String projectPath = myProjectPathField.getText();
+ if (myOriginalSettings == null) {
+ return String.format(
+ "Can't store external task settings into run configuration. Reason: target run configuration is undefined. Tasks: '%s', " +
+ "external project: '%s', vm options: '%s'", myTasksTextField.getText(), projectPath, myVmOptionsEditor.getText()
+ );
+ }
+ settings.setExternalProjectPath(projectPath);
+ if (!StringUtil.isEmpty(projectPath)) {
+ ExternalSystemApiUtil.storeLastUsedExternalProjectPath(projectPath, myExternalSystemId);
+ }
+ settings.setTaskNames(StringUtil.split(myTasksTextField.getText(), " "));
+ settings.setVmOptions(myVmOptionsEditor.getText());
+ return null;
+ }
+
+ @Override
+ public void disposeUIResources() {
+ ExternalSystemUiUtil.disposeUi(this);
+ }
+
+ @Override
+ public void showUi(boolean show) {
+ ExternalSystemUiUtil.showUi(this, show);
+ }
+}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/AbstractExternalSystemTask.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/AbstractExternalSystemTask.java
index 71563ca9c50b..806db99d8c0a 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/AbstractExternalSystemTask.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/AbstractExternalSystemTask.java
@@ -35,7 +35,7 @@ public abstract class AbstractExternalSystemTask implements ExternalSystemTask {
@NotNull private final ExternalSystemTaskId myId;
@NotNull private final ProjectSystemId myExternalSystemId;
- @NotNull private final String myExernalProjectPath;
+ @NotNull private final String myExternalProjectPath;
protected AbstractExternalSystemTask(@NotNull ProjectSystemId id,
@NotNull ExternalSystemTaskType type,
@@ -45,7 +45,7 @@ public abstract class AbstractExternalSystemTask implements ExternalSystemTask {
myExternalSystemId = id;
myIdeProject = project;
myId = ExternalSystemTaskId.create(type, myIdeProject);
- myExernalProjectPath = externalProjectPath;
+ myExternalProjectPath = externalProjectPath;
}
@NotNull
@@ -77,13 +77,18 @@ public abstract class AbstractExternalSystemTask implements ExternalSystemTask {
return myIdeProject;
}
+ @NotNull
+ public String getExternalProjectPath() {
+ return myExternalProjectPath;
+ }
+
public void refreshState() {
if (getState() != ExternalSystemTaskState.IN_PROGRESS) {
return;
}
final ExternalSystemFacadeManager manager = ServiceManager.getService(ExternalSystemFacadeManager.class);
try {
- final RemoteExternalSystemFacade facade = manager.getFacade(myIdeProject, myExernalProjectPath, myExternalSystemId);
+ final RemoteExternalSystemFacade facade = manager.getFacade(myIdeProject, myExternalProjectPath, myExternalSystemId);
setState(facade.isTaskInProgress(getId()) ? ExternalSystemTaskState.IN_PROGRESS : ExternalSystemTaskState.FAILED);
}
catch (Throwable e) {
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemExecuteTaskTask.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemExecuteTaskTask.java
index 0bcfa95c59a8..2c20df8cb3fb 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemExecuteTaskTask.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemExecuteTaskTask.java
@@ -17,12 +17,21 @@ package com.intellij.openapi.externalSystem.service.internal;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
-import com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask;
+import com.intellij.openapi.externalSystem.model.serialization.ExternalTaskPojo;
+import com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings;
+import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskState;
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType;
import com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager;
+import com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacade;
+import com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemTaskManager;
+import com.intellij.openapi.externalSystem.settings.ExternalSystemSettingsManager;
import com.intellij.openapi.project.Project;
+import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtilRt;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import java.util.Collection;
import java.util.List;
/**
@@ -31,31 +40,68 @@ import java.util.List;
*/
public class ExternalSystemExecuteTaskTask extends AbstractExternalSystemTask {
- @NotNull private final List myTasksToExecute;
- @NotNull private final String myGradleProjectPath;
+ @NotNull private static final Function MAPPER = new Function() {
+ @Override
+ public String fun(ExternalTaskPojo task) {
+ return task.getName();
+ }
+ };
+
+ @NotNull private final List myTasksToExecute;
+ @Nullable private final String myVmOptions;
public ExternalSystemExecuteTaskTask(@NotNull ProjectSystemId externalSystemId,
@NotNull Project project,
- @NotNull String gradleProjectPath,
- @NotNull List tasksToExecute)
+ @NotNull List tasksToExecute,
+ @Nullable String vmOptions) throws IllegalArgumentException
{
- super(externalSystemId, ExternalSystemTaskType.EXECUTE_TASK, project, gradleProjectPath);
- myGradleProjectPath = gradleProjectPath;
+ super(externalSystemId, ExternalSystemTaskType.EXECUTE_TASK, project, getLinkedExternalProjectPath(tasksToExecute));
myTasksToExecute = tasksToExecute;
+ myVmOptions = vmOptions;
}
+ @NotNull
+ private static String getLinkedExternalProjectPath(@NotNull Collection tasks) throws IllegalArgumentException {
+ if (tasks.isEmpty()) {
+ throw new IllegalArgumentException("Can't execute external tasks. Reason: given tasks list is empty");
+ }
+ String result = null;
+ for (ExternalTaskPojo task : tasks) {
+ String path = task.getLinkedExternalProjectPath();
+ if (result == null) {
+ result = path;
+ }
+ else if (!result.equals(path)) {
+ throw new IllegalArgumentException(String.format(
+ "Can't execute given external system tasks. Reason: expected that all of them belong to the same external project " +
+ "but they are not (at least two different projects detected - '%s' and '%s'). Tasks: %s",
+ result,
+ task.getLinkedExternalProjectPath(),
+ tasks));
+ }
+ }
+ assert result != null;
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
@Override
protected void doExecute() throws Exception {
final ExternalSystemFacadeManager manager = ServiceManager.getService(ExternalSystemFacadeManager.class);
- Project project = getIdeProject();
- // TODO den implement
-// ExternalSystemBuildManager buildManager = manager.getFacade(project).getBuildManager();
-// setState(GradleTaskState.IN_PROGRESS);
-// try {
-// buildManager.executeTasks(getId(), myTasksToExecute, myGradleProjectPath);
-// }
-// finally {
-// setState(GradleTaskState.FINISHED);
-// }
+ ExternalSystemSettingsManager settingsManager = ServiceManager.getService(ExternalSystemSettingsManager.class);
+ ExternalSystemExecutionSettings settings = settingsManager.getExecutionSettings(getIdeProject(),
+ getExternalProjectPath(),
+ getExternalSystemId());
+ RemoteExternalSystemFacade facade = manager.getFacade(getIdeProject(), getExternalProjectPath(), getExternalSystemId());
+ RemoteExternalSystemTaskManager taskManager = facade.getTaskManager();
+ List taskNames = ContainerUtilRt.map2List(myTasksToExecute, MAPPER);
+
+ setState(ExternalSystemTaskState.IN_PROGRESS);
+ try {
+ taskManager.executeTasks(getId(), taskNames, getExternalProjectPath(), settings, myVmOptions);
+ }
+ finally {
+ setState(ExternalSystemTaskState.FINISHED);
+ }
}
}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemProcessingManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemProcessingManager.java
index 05743ef6bf2b..49502284eb01 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemProcessingManager.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemProcessingManager.java
@@ -107,6 +107,11 @@ public class ExternalSystemProcessingManager implements ExternalSystemTaskNotifi
myTasksInProgress.put(event.getId(), System.currentTimeMillis() + TOO_LONG_EXECUTION_MS);
}
+ @Override
+ public void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) {
+ myTasksInProgress.put(id, System.currentTimeMillis() + TOO_LONG_EXECUTION_MS);
+ }
+
@Override
public void onEnd(@NotNull ExternalSystemTaskId id) {
myTasksInProgress.remove(id);
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportBuilder.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportBuilder.java
index 93f8f747c169..123cecf95f14 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportBuilder.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportBuilder.java
@@ -309,7 +309,7 @@ public abstract class AbstractExternalProjectImportBuilder> entry : myListeners.entrySet()) {
+ final Set ids = entry.getValue();
+ if (Collections.EMPTY_SET == ids || ids.contains(id)) {
+ entry.getKey().onTaskOutput(id, text, stdOut);
+ }
+ }
+ }
+
@Override
public void onEnd(@NotNull ExternalSystemTaskId id) {
for (Map.Entry> entry : myListeners.entrySet()) {
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemProgressNotificationManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemProgressNotificationManager.java
index 8f65369ce1f0..a3ba55c430b3 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemProgressNotificationManager.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemProgressNotificationManager.java
@@ -30,6 +30,10 @@ public interface RemoteExternalSystemProgressNotificationManager extends Remote
public void onStatusChange(@NotNull ExternalSystemTaskNotificationEvent event) {
}
+ @Override
+ public void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) {
+ }
+
@Override
public void onEnd(@NotNull ExternalSystemTaskId id) {
}
@@ -41,5 +45,7 @@ public interface RemoteExternalSystemProgressNotificationManager extends Remote
void onStatusChange(@NotNull ExternalSystemTaskNotificationEvent event) throws RemoteException;
+ void onTaskOutput(@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) throws RemoteException;
+
void onEnd(@NotNull ExternalSystemTaskId id) throws RemoteException;
}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemProjectResolverImpl.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemProjectResolverImpl.java
index e90dd2288437..e8125bdbb281 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemProjectResolverImpl.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemProjectResolverImpl.java
@@ -29,16 +29,16 @@ public class RemoteExternalSystemProjectResolverImpl resolveProjectInfo(@NotNull final ExternalSystemTaskId id,
- @NotNull final String projectPath,
- final boolean downloadLibraries,
- ExternalSystemExecutionSettings settings)
+ @NotNull final String projectPath,
+ final boolean downloadLibraries,
+ ExternalSystemExecutionSettings settings)
throws ExternalSystemException, IllegalArgumentException, IllegalStateException
{
return execute(id, new Producer>() {
@Nullable
@Override
public DataNode produce() {
- return myDelegate.resolveProjectInfo(id, projectPath, downloadLibraries, getSettings());
+ return myDelegate.resolveProjectInfo(id, projectPath, downloadLibraries, getSettings(), getNotificationListener());
}
});
}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemTaskManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemTaskManager.java
index 01dbc5b925f0..e7a4612daebd 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemTaskManager.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemTaskManager.java
@@ -44,7 +44,8 @@ public interface RemoteExternalSystemTaskManager taskNames,
@NotNull String projectPath,
- @Nullable ExternalSystemExecutionSettings settings) throws RemoteException, ExternalSystemException
+ @Nullable ExternalSystemExecutionSettings settings,
+ @Nullable String vmOptions) throws RemoteException, ExternalSystemException
{
}
@@ -68,6 +69,9 @@ public interface RemoteExternalSystemTaskManager taskNames, @NotNull String projectPath, @Nullable S settings)
- throws RemoteException, ExternalSystemException;
+ void executeTasks(@NotNull ExternalSystemTaskId id,
+ @NotNull List taskNames,
+ @NotNull String projectPath,
+ @Nullable S settings,
+ @Nullable String vmOptions) throws RemoteException, ExternalSystemException;
}
diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemTaskManagerImpl.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemTaskManagerImpl.java
index de5ce33fe438..763ca22da1fa 100644
--- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemTaskManagerImpl.java
+++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/remote/RemoteExternalSystemTaskManagerImpl.java
@@ -15,7 +15,7 @@
*/
package com.intellij.openapi.externalSystem.service.remote;
-import com.intellij.openapi.externalSystem.build.ExternalSystemTaskManager;
+import com.intellij.openapi.externalSystem.task.ExternalSystemTaskManager;
import com.intellij.openapi.externalSystem.model.ExternalSystemException;
import com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings;
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
@@ -44,13 +44,14 @@ public class RemoteExternalSystemTaskManagerImpl taskNames,
@NotNull final String projectPath,
- @Nullable final S settings) throws RemoteException, ExternalSystemException
+ @Nullable final S settings,
+ @Nullable final String vmOptions) throws RemoteException, ExternalSystemException
{
execute(id, new Producer