Search in sources :

Example 1 with RemoteExternalSystemFacade

use of com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacade in project intellij-community by JetBrains.

the class AbstractExternalSystemTask method refreshState.

public void refreshState() {
    if (getState() != ExternalSystemTaskState.IN_PROGRESS) {
        return;
    }
    final ExternalSystemFacadeManager manager = ServiceManager.getService(ExternalSystemFacadeManager.class);
    try {
        final RemoteExternalSystemFacade facade = manager.getFacade(myIdeProject, myExternalProjectPath, myExternalSystemId);
        setState(facade.isTaskInProgress(getId()) ? ExternalSystemTaskState.IN_PROGRESS : ExternalSystemTaskState.FAILED);
    } catch (Throwable e) {
        setState(ExternalSystemTaskState.FAILED);
        myError.set(e);
        if (!myIdeProject.isDisposed()) {
            LOG.warn(e);
        }
    }
}
Also used : ExternalSystemFacadeManager(com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager) RemoteExternalSystemFacade(com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacade)

Example 2 with RemoteExternalSystemFacade

use of com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacade in project intellij-community by JetBrains.

the class ExternalSystemExecuteTaskTask method doCancel.

@Override
protected boolean doCancel() throws Exception {
    final ExternalSystemFacadeManager manager = ServiceManager.getService(ExternalSystemFacadeManager.class);
    RemoteExternalSystemFacade facade = manager.getFacade(getIdeProject(), getExternalProjectPath(), getExternalSystemId());
    RemoteExternalSystemTaskManager taskManager = facade.getTaskManager();
    return taskManager.cancelTask(getId());
}
Also used : RemoteExternalSystemTaskManager(com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemTaskManager) ExternalSystemFacadeManager(com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager) RemoteExternalSystemFacade(com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacade)

Example 3 with RemoteExternalSystemFacade

use of com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacade in project intellij-community by JetBrains.

the class ExternalSystemExecuteTaskTask method doExecute.

@SuppressWarnings("unchecked")
@Override
protected void doExecute() throws Exception {
    final ExternalSystemFacadeManager manager = ServiceManager.getService(ExternalSystemFacadeManager.class);
    ExternalSystemExecutionSettings settings = ExternalSystemApiUtil.getExecutionSettings(getIdeProject(), getExternalProjectPath(), getExternalSystemId());
    KeyFMap keyFMap = getUserMap();
    for (Key key : keyFMap.getKeys()) {
        settings.putUserData(key, keyFMap.get(key));
    }
    RemoteExternalSystemFacade facade = manager.getFacade(getIdeProject(), getExternalProjectPath(), getExternalSystemId());
    RemoteExternalSystemTaskManager taskManager = facade.getTaskManager();
    List<String> taskNames = ContainerUtilRt.map2List(myTasksToExecute, ExternalTaskPojo::getName);
    final List<String> vmOptions = parseCmdParameters(myVmOptions);
    final List<String> arguments = parseCmdParameters(myArguments);
    settings.withVmOptions(vmOptions).withArguments(arguments);
    taskManager.executeTasks(getId(), taskNames, getExternalProjectPath(), settings, myJvmAgentSetup);
}
Also used : ExternalTaskPojo(com.intellij.openapi.externalSystem.model.execution.ExternalTaskPojo) KeyFMap(com.intellij.util.keyFMap.KeyFMap) RemoteExternalSystemTaskManager(com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemTaskManager) ExternalSystemFacadeManager(com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager) RemoteExternalSystemFacade(com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacade) ExternalSystemExecutionSettings(com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings) Key(com.intellij.openapi.util.Key)

Aggregations

ExternalSystemFacadeManager (com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager)3 RemoteExternalSystemFacade (com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacade)3 RemoteExternalSystemTaskManager (com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemTaskManager)2 ExternalTaskPojo (com.intellij.openapi.externalSystem.model.execution.ExternalTaskPojo)1 ExternalSystemExecutionSettings (com.intellij.openapi.externalSystem.model.settings.ExternalSystemExecutionSettings)1 Key (com.intellij.openapi.util.Key)1 KeyFMap (com.intellij.util.keyFMap.KeyFMap)1