Java Code Examples for com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil#getExecutionSettings()

The following examples show how to use com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil#getExecutionSettings() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExternalSystemFacadeManager.java    From consulo with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Nonnull
private RemoteExternalSystemFacade doCreateFacade(@Nonnull IntegrationKey key, @Nonnull Project project,
                                                  @Nonnull ExternalSystemCommunicationManager communicationManager) throws Exception {
  final RemoteExternalSystemFacade facade = communicationManager.acquire(project.getName(), key.getExternalSystemId());
  if (facade == null) {
    throw new IllegalStateException("Can't obtain facade to working with external api at the remote process. Project: " + project);
  }
  Disposer.register(project, new Disposable() {
    @Override
    public void dispose() {
      myFacadeWrappers.clear();
      myRemoteFacades.clear();
    }
  });
  final RemoteExternalSystemFacade result = new ExternalSystemFacadeWrapper(facade, myProgressManager);
  ExternalSystemExecutionSettings settings
    = ExternalSystemApiUtil.getExecutionSettings(project, key.getExternalProjectConfigPath(), key.getExternalSystemId());
  Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings> newPair = Pair.create(result, settings);
  myRemoteFacades.put(key, newPair);
  result.applySettings(newPair.second);
  return result;
}
 
Example 2
Source File: ExternalSystemFacadeManager.java    From consulo with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
private boolean prepare(@Nonnull ExternalSystemCommunicationManager communicationManager,
                        @Nonnull Project project, @Nonnull IntegrationKey key,
                        @Nonnull Pair<RemoteExternalSystemFacade, ExternalSystemExecutionSettings> pair)
{
   if (!communicationManager.isAlive(pair.first)) {
    return false;
  }
  try {
    ExternalSystemExecutionSettings currentSettings
      = ExternalSystemApiUtil.getExecutionSettings(project, key.getExternalProjectConfigPath(), key.getExternalSystemId());
    if (!currentSettings.equals(pair.second)) {
      pair.first.applySettings(currentSettings);
      myRemoteFacades.put(key, Pair.create(pair.first, currentSettings));
    }
    return true;
  }
  catch (RemoteException e) {
    return false;
  }
}
 
Example 3
Source File: ExternalSystemExecuteTaskTask.java    From consulo with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected void doExecute() throws Exception {
  final ExternalSystemFacadeManager manager = ServiceManager.getService(ExternalSystemFacadeManager.class);
  ExternalSystemExecutionSettings settings = ExternalSystemApiUtil.getExecutionSettings(getIdeProject(),
                                                                                        getExternalProjectPath(),
                                                                                        getExternalSystemId());
  RemoteExternalSystemFacade facade = manager.getFacade(getIdeProject(), getExternalProjectPath(), getExternalSystemId());
  RemoteExternalSystemTaskManager taskManager = facade.getTaskManager();
  List<String> taskNames = ContainerUtilRt.map2List(myTasksToExecute, MAPPER);

  final List<String> vmOptions = parseCmdParameters(myVmOptions);
  final List<String> scriptParametersList = parseCmdParameters(myScriptParameters);

  taskManager.executeTasks(getId(), taskNames, getExternalProjectPath(), settings, vmOptions, scriptParametersList, myDebuggerSetup);
}
 
Example 4
Source File: ExternalSystemResolveProjectTask.java    From consulo with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
protected void doExecute() throws Exception {
  final ExternalSystemFacadeManager manager = ServiceManager.getService(ExternalSystemFacadeManager.class);
  Project ideProject = getIdeProject();
  RemoteExternalSystemProjectResolver resolver = manager.getFacade(ideProject, myProjectPath, getExternalSystemId()).getResolver();
  ExternalSystemExecutionSettings settings = ExternalSystemApiUtil.getExecutionSettings(ideProject, myProjectPath, getExternalSystemId());

  DataNode<ProjectData> project = resolver.resolveProjectInfo(getId(), myProjectPath, myIsPreviewMode, settings);

  if (project == null) {
    return;
  }
  myExternalProject.set(project);
}