Search in sources :

Example 1 with IdeaSpecificSettings

use of org.jetbrains.idea.eclipse.conversion.IdeaSpecificSettings in project intellij-community by JetBrains.

the class EclipseClasspathConverter method readClasspath.

@Override
public void readClasspath(@NotNull ModifiableRootModel model) throws IOException {
    try {
        CachedXmlDocumentSet fileSet = getFileSet();
        String path = fileSet.getParent(EclipseXml.PROJECT_FILE);
        Element classpath = null;
        if (!fileSet.exists(EclipseXml.PROJECT_FILE)) {
            classpath = fileSet.load(EclipseXml.CLASSPATH_FILE, false);
            if (classpath == null) {
                return;
            }
            path = fileSet.getParent(EclipseXml.CLASSPATH_FILE);
        }
        EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, module.getProject(), null);
        classpathReader.init(model);
        if (classpath == null) {
            classpath = fileSet.load(EclipseXml.CLASSPATH_FILE, false);
        }
        if (classpath == null) {
            EclipseClasspathReader.setOutputUrl(model, path + "/bin");
        } else {
            classpathReader.readClasspath(model, classpath);
        }
        Element eml = fileSet.load(model.getModule().getName() + EclipseXml.IDEA_SETTINGS_POSTFIX, false);
        if (eml == null) {
            model.getModuleExtension(CompilerModuleExtension.class).setExcludeOutput(false);
        } else {
            new IdeaSpecificSettings().readIdeaSpecific(eml, model, null, null);
        }
    } catch (JDOMException e) {
        throw new IOException(e);
    }
}
Also used : Element(org.jdom.Element) IdeaSpecificSettings(org.jetbrains.idea.eclipse.conversion.IdeaSpecificSettings) EclipseClasspathReader(org.jetbrains.idea.eclipse.conversion.EclipseClasspathReader) IOException(java.io.IOException) JDOMException(org.jdom.JDOMException) CompilerModuleExtension(com.intellij.openapi.roots.CompilerModuleExtension)

Aggregations

CompilerModuleExtension (com.intellij.openapi.roots.CompilerModuleExtension)1 IOException (java.io.IOException)1 Element (org.jdom.Element)1 JDOMException (org.jdom.JDOMException)1 EclipseClasspathReader (org.jetbrains.idea.eclipse.conversion.EclipseClasspathReader)1 IdeaSpecificSettings (org.jetbrains.idea.eclipse.conversion.IdeaSpecificSettings)1