mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
eclipse: do not warn about output if it was configured via path variable/linked resources (IDEA-71689)
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
<orderEntry type="module" module-name="junit" scope="TEST" />
|
||||
<orderEntry type="module" module-name="testng" scope="TEST" />
|
||||
<orderEntry type="module" module-name="ui-designer" scope="TEST" />
|
||||
<orderEntry type="module" module-name="eclipse" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.jetbrains.idea.eclipse.config;
|
||||
|
||||
import com.intellij.openapi.components.PathMacroManager;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.roots.*;
|
||||
@@ -83,7 +84,7 @@ public class EclipseClasspathStorageProvider implements ClasspathStorageProvider
|
||||
}
|
||||
final String output = model.getModuleExtension(CompilerModuleExtension.class).getCompilerOutputUrl();
|
||||
final String contentRoot = getContentRoot(model);
|
||||
if (output == null || !StringUtil.startsWith(VfsUtil.urlToPath(output), contentRoot)) {
|
||||
if (output == null || !StringUtil.startsWith(VfsUtil.urlToPath(output), contentRoot) && PathMacroManager.getInstance(model.getModule()).collapsePath(output).equals(output)) {
|
||||
throw new ConfigurationException("Module \'" + moduleName + "\' output path is incompatible with eclipse format which supports output under content root only.\nPlease make sure that \"Inherit project compile output path\" is not selected");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.intellij.openapi.application.PluginPathManager;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.module.StdModuleTypes;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
@@ -38,6 +39,7 @@ import junit.framework.Assert;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jetbrains.idea.eclipse.config.EclipseClasspathStorageProvider;
|
||||
import org.jetbrains.idea.eclipse.conversion.ConversionException;
|
||||
import org.jetbrains.idea.eclipse.conversion.EclipseClasspathReader;
|
||||
import org.jetbrains.idea.eclipse.conversion.EclipseClasspathWriter;
|
||||
@@ -72,7 +74,8 @@ public class EclipseClasspathTest extends IdeaTestCase {
|
||||
checkModule(path, setUpModule(path, project));
|
||||
}
|
||||
|
||||
static Module setUpModule(final String path, final Project project) throws IOException, JDOMException, ConversionException {
|
||||
static Module setUpModule(final String path, final Project project)
|
||||
throws IOException, JDOMException, ConversionException, ConfigurationException {
|
||||
final File classpathFile = new File(path, EclipseXml.DOT_CLASSPATH_EXT);
|
||||
String fileText = FileUtil.loadFile(classpathFile).replaceAll("\\$ROOT\\$", project.getBaseDir().getPath());
|
||||
if (!SystemInfo.isWindows) {
|
||||
@@ -92,12 +95,12 @@ public class EclipseClasspathTest extends IdeaTestCase {
|
||||
classpathReader
|
||||
.readClasspath(rootModel, new ArrayList<String>(), new ArrayList<String>(), new HashSet<String>(), new HashSet<String>(), null,
|
||||
classpathElement);
|
||||
new EclipseClasspathStorageProvider().assertCompatible(rootModel);
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
rootModel.commit();
|
||||
}
|
||||
});
|
||||
|
||||
return module;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user