use of com.intellij.openapi.externalSystem.service.remote.ExternalSystemProgressNotificationManagerImpl in project intellij-community by JetBrains.
the class ExternalSystemResolveProjectTask method doExecute.
@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());
if (StringUtil.isNotEmpty(myVmOptions)) {
settings.withVmOptions(ParametersListUtil.parse(myVmOptions));
}
if (StringUtil.isNotEmpty(myArguments)) {
settings.withArguments(ParametersListUtil.parse(myArguments));
}
ExternalSystemProgressNotificationManagerImpl progressNotificationManager = (ExternalSystemProgressNotificationManagerImpl) ServiceManager.getService(ExternalSystemProgressNotificationManager.class);
ExternalSystemTaskId id = getId();
progressNotificationManager.onStart(id, myProjectPath);
try {
DataNode<ProjectData> project = resolver.resolveProjectInfo(id, myProjectPath, myIsPreviewMode, settings);
if (project != null) {
myExternalProject.set(project);
ExternalSystemManager<?, ?, ?, ?, ?> systemManager = ExternalSystemApiUtil.getManager(getExternalSystemId());
assert systemManager != null;
Set<String> externalModulePaths = ContainerUtil.newHashSet();
Collection<DataNode<ModuleData>> moduleNodes = ExternalSystemApiUtil.findAll(project, ProjectKeys.MODULE);
for (DataNode<ModuleData> node : moduleNodes) {
externalModulePaths.add(node.getData().getLinkedExternalProjectPath());
}
String projectPath = project.getData().getLinkedExternalProjectPath();
ExternalProjectSettings linkedProjectSettings = systemManager.getSettingsProvider().fun(ideProject).getLinkedProjectSettings(projectPath);
if (linkedProjectSettings != null) {
linkedProjectSettings.setModules(externalModulePaths);
}
}
progressNotificationManager.onSuccess(id);
} finally {
progressNotificationManager.onEnd(id);
}
}
Aggregations