use of com.intellij.openapi.externalSystem.model.execution.ExternalTaskPojo 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);
}
use of com.intellij.openapi.externalSystem.model.execution.ExternalTaskPojo in project intellij-community by JetBrains.
the class ExternalSystemBeforeRunTaskProvider method canExecuteTask.
@Override
public boolean canExecuteTask(RunConfiguration configuration, ExternalSystemBeforeRunTask beforeRunTask) {
final ExternalSystemTaskExecutionSettings executionSettings = beforeRunTask.getTaskExecutionSettings();
final List<ExternalTaskPojo> tasks = ContainerUtilRt.newArrayList();
for (String taskName : executionSettings.getTaskNames()) {
tasks.add(new ExternalTaskPojo(taskName, executionSettings.getExternalProjectPath(), null));
}
if (tasks.isEmpty())
return true;
ExecutionEnvironment environment = ExternalSystemUtil.createExecutionEnvironment(myProject, mySystemId, executionSettings, DefaultRunExecutor.EXECUTOR_ID);
if (environment == null)
return false;
return environment.getRunner().canRun(DefaultRunExecutor.EXECUTOR_ID, environment.getRunProfile());
}
Aggregations