Search in sources :

Example 1 with EclipseClasspathConverter

use of org.jetbrains.idea.eclipse.config.EclipseClasspathConverter in project intellij-community by JetBrains.

the class EclipseEmlTest method doLoadModule.

private static Module doLoadModule(@NotNull String path, @NotNull Project project) throws IOException, JDOMException, InvalidDataException {
    Module module = WriteAction.compute(() -> ModuleManager.getInstance(project).newModule(path + '/' + EclipseProjectFinder.findProjectName(path) + ModuleManagerImpl.IML_EXTENSION, StdModuleTypes.JAVA.getId()));
    replaceRoot(path, EclipseXml.DOT_CLASSPATH_EXT, project);
    ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel();
    new EclipseClasspathConverter(module).readClasspath(rootModel);
    WriteAction.run(() -> rootModel.commit());
    return module;
}
Also used : ModifiableRootModel(com.intellij.openapi.roots.ModifiableRootModel) EclipseClasspathConverter(org.jetbrains.idea.eclipse.config.EclipseClasspathConverter) Module(com.intellij.openapi.module.Module)

Aggregations

Module (com.intellij.openapi.module.Module)1 ModifiableRootModel (com.intellij.openapi.roots.ModifiableRootModel)1 EclipseClasspathConverter (org.jetbrains.idea.eclipse.config.EclipseClasspathConverter)1