From bbf62a3439f787b55fb357d1cb3ca385565eac8f Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Fri, 11 Dec 2009 16:09:26 +0300 Subject: [PATCH 1/9] Maven: cosmetics --- .../maven/importing/StructureImportingTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/StructureImportingTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/StructureImportingTest.java index 08bc9a7dd6d3..76540e195afa 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/StructureImportingTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/importing/StructureImportingTest.java @@ -629,7 +629,7 @@ public class StructureImportingTest extends MavenImportingTestCase { ""); assertModules("project"); - assertEquals(LanguageLevel.JDK_1_4, getLanguageLevelForProject()); + assertEquals(LanguageLevel.JDK_1_4, getLanguageLevelForModule()); } public void testLanguageLevel6() throws Exception { @@ -650,7 +650,7 @@ public class StructureImportingTest extends MavenImportingTestCase { ""); assertModules("project"); - assertEquals(LanguageLevel.JDK_1_6, getLanguageLevelForProject()); + assertEquals(LanguageLevel.JDK_1_6, getLanguageLevelForModule()); } public void testLanguageLevelWhenCompilerPluginIsNotSpecified() throws Exception { @@ -659,7 +659,7 @@ public class StructureImportingTest extends MavenImportingTestCase { "1"); assertModules("project"); - assertNull(getLanguageLevelForProject()); + assertNull(getLanguageLevelForModule()); } public void testLanguageLevelWhenConfigurationIsNotSpecified() throws Exception { @@ -677,10 +677,10 @@ public class StructureImportingTest extends MavenImportingTestCase { ""); assertModules("project"); - assertNull(getLanguageLevelForProject()); + assertNull(getLanguageLevelForModule()); } - public void testLanguageLevelWhenSourseLanguageLevelIsNotSpecified() throws Exception { + public void testLanguageLevelWhenSourceLanguageLevelIsNotSpecified() throws Exception { importProject("test" + "project" + "1" + @@ -697,10 +697,10 @@ public class StructureImportingTest extends MavenImportingTestCase { ""); assertModules("project"); - assertNull(getLanguageLevelForProject()); + assertNull(getLanguageLevelForModule()); } - private LanguageLevel getLanguageLevelForProject() { + private LanguageLevel getLanguageLevelForModule() { return LanguageLevelModuleExtension.getInstance(getModule("project")).getLanguageLevel(); } From bc950a98247a7ff7082ce1d7c2ab468e021a4d49 Mon Sep 17 00:00:00 2001 From: "Anton.Makeev" Date: Fri, 18 Dec 2009 17:08:06 +0300 Subject: [PATCH 2/9] Maven: recompiling resources when profiles change (IDEADEV-41972) --- .../maven/compiler/MavenResourceCompiler.java | 44 +++--- .../jetbrains/idea/maven/MavenTestCase.java | 2 +- .../maven/compiler/ResourceFilteringTest.java | 139 +++++++++++++++++- 3 files changed, 159 insertions(+), 26 deletions(-) diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java index 07d0813e8a60..cc643a3942cf 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java @@ -147,7 +147,7 @@ public class MavenResourceCompiler implements ClassPostProcessingCompiler { MavenProject mavenProject = mavenProjectManager.findProject(eachModule); if (mavenProject == null) continue; - Properties properties = loadFilters(context, mavenProject); + Properties properties = loadPropertiesAndFilters(context, mavenProject); List nonFilteredExtensions = collectNonFilteredExtensions(mavenProject); String escapeString = mavenProject.findPluginConfigurationValue("org.apache.maven.plugins", @@ -202,8 +202,10 @@ public class MavenResourceCompiler implements ClassPostProcessingCompiler { return sorted.hashCode(); } - private static Properties loadFilters(CompileContext context, MavenProject mavenProject) { + private static Properties loadPropertiesAndFilters(CompileContext context, MavenProject mavenProject) { Properties properties = new Properties(); + properties.putAll(mavenProject.getProperties()); + for (String each : mavenProject.getFilters()) { try { FileInputStream in = new FileInputStream(each); @@ -509,7 +511,7 @@ public class MavenResourceCompiler implements ClassPostProcessingCompiler { private LightVirtualFile myFile; private FakeProcessingItem() { - myFile = new LightVirtualFile("fooBar"); + myFile = new LightVirtualFile(this.getClass().getName()); } @NotNull @@ -523,52 +525,50 @@ public class MavenResourceCompiler implements ClassPostProcessingCompiler { } private static class MyValididtyState implements ValidityState { - private final TimestampValidityState myTimestampState; + private final long mySourceFileTimestamp; private volatile long myOutputFileTimestamp; private final boolean myFiltered; private final long myPropertiesHashCode; private final String myEscapeString; public static MyValididtyState load(DataInput in) throws IOException { - return new MyValididtyState(TimestampValidityState.load(in), in.readLong(), in.readBoolean(), in.readLong(), in.readUTF()); - } - - public MyValididtyState(long sourceFileTimestamp, - long outputFileTimestamp, - boolean isFiltered, - long propertiesHashCode, - String escapeString) { - this(new TimestampValidityState(sourceFileTimestamp), outputFileTimestamp, isFiltered, propertiesHashCode, escapeString); + return new MyValididtyState(in.readLong(), in.readLong(), in.readBoolean(), in.readLong(), in.readUTF()); } public void setOutputFileTimestamp(long outputFileTimestamp) { myOutputFileTimestamp = outputFileTimestamp; } - private MyValididtyState(TimestampValidityState timestampState, + private MyValididtyState(long sourceFileTimestamp, long outputFileTimestamp, boolean isFiltered, long propertiesHashCode, String escapeString) { - myTimestampState = timestampState; + mySourceFileTimestamp = sourceFileTimestamp; myOutputFileTimestamp = outputFileTimestamp; myFiltered = isFiltered; myPropertiesHashCode = propertiesHashCode; myEscapeString = escapeString; } + @Override + public String toString() { + return mySourceFileTimestamp + " " + myOutputFileTimestamp + " " + myFiltered + " " + myPropertiesHashCode + " " + myEscapeString; + } + public boolean equalsTo(ValidityState otherState) { if (!(otherState instanceof MyValididtyState)) return false; - MyValididtyState state = (MyValididtyState)otherState; - return myTimestampState.equalsTo(state.myTimestampState) - && myOutputFileTimestamp == state.myOutputFileTimestamp - && myFiltered == state.myFiltered - && myPropertiesHashCode == state.myPropertiesHashCode - && Comparing.strEqual(myEscapeString, state.myEscapeString); + MyValididtyState that = (MyValididtyState)otherState; + + return mySourceFileTimestamp == that.mySourceFileTimestamp + && myOutputFileTimestamp == that.myOutputFileTimestamp + && myFiltered == that.myFiltered + && myPropertiesHashCode == that.myPropertiesHashCode + && Comparing.strEqual(myEscapeString, that.myEscapeString); } public void save(DataOutput out) throws IOException { - myTimestampState.save(out); + out.writeLong(mySourceFileTimestamp); out.writeLong(myOutputFileTimestamp); out.writeBoolean(myFiltered); out.writeLong(myPropertiesHashCode); diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenTestCase.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenTestCase.java index 03645729e4b8..e70f1ee42a8c 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenTestCase.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenTestCase.java @@ -367,7 +367,7 @@ public abstract class MavenTestCase extends UsefulTestCase { } private void setFileContent(VirtualFile file, String content) throws IOException { - file.setBinaryContent(content.getBytes(), -1, file.getTimeStamp() + 1000); + file.setBinaryContent(content.getBytes(), file.getModificationStamp() + 4000, file.getTimeStamp() + 4000); } protected void assertPathEquals(String expected, String actual) { diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/compiler/ResourceFilteringTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/compiler/ResourceFilteringTest.java index 755a4b580476..eaa612b1623b 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/compiler/ResourceFilteringTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/compiler/ResourceFilteringTest.java @@ -15,13 +15,25 @@ */ package org.jetbrains.idea.maven.compiler; +import com.intellij.compiler.CompilerManagerImpl; +import com.intellij.compiler.CompilerWorkspaceConfiguration; +import com.intellij.compiler.impl.ModuleCompileScope; +import com.intellij.compiler.impl.TranslatingCompilerFilesMonitor; +import com.intellij.openapi.compiler.*; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.roots.ProjectRootManager; +import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.idea.maven.MavenImportingTestCase; import org.jetbrains.idea.maven.importing.MavenDefaultModifiableModelsProvider; import org.jetbrains.idea.maven.importing.MavenRootModelAdapter; +import java.io.File; import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public class ResourceFilteringTest extends MavenImportingTestCase { public void testBasic() throws Exception { @@ -114,7 +126,7 @@ public class ResourceFilteringTest extends MavenImportingTestCase { assertResult("target/classes/file.bmp", "value=${project.version}"); } - + public void testCustomNonFilteredExtensions() throws Exception { createProjectSubFile("resources/file.bmp", "value=${project.version}"); createProjectSubFile("resources/file.xxx", "value=${project.version}"); @@ -239,7 +251,7 @@ public class ResourceFilteringTest extends MavenImportingTestCase { assertResult("target/classes/file1.properties", "value=project"); assertResult("target/classes/file2.properties", "value=${project.artifactId}"); } - + public void testEscapingSpecialCharsInProperties() throws Exception { createProjectSubFile("resources/file.txt", "value=${foo}"); @@ -414,7 +426,7 @@ public class ResourceFilteringTest extends MavenImportingTestCase { assertResult("target/classes/file.properties", "value=${project.version}"); } - public void testUpdatingWhenPropertiesAreChanged() throws Exception { + public void testUpdatingWhenPropertiesInFiltersAreChanged() throws Exception { VirtualFile filter = createProjectSubFile("filters/filter.properties", "xxx=1"); createProjectSubFile("resources/file.properties", "value=${xxx}"); @@ -441,6 +453,127 @@ public class ResourceFilteringTest extends MavenImportingTestCase { assertResult("target/classes/file.properties", "value=2"); } + public void testUpdatingWhenPropertiesAreChanged() throws Exception { + createProjectSubFile("resources/file.properties", "value=${foo}"); + + importProject("test" + + "project" + + "1" + + + "" + + " val1" + + "" + + + "" + + " " + + " " + + " resources" + + " true" + + " " + + " " + + ""); + compileModules("project"); + assertResult("target/classes/file.properties", "value=val1"); + + importProject("test" + + "project" + + "1" + + + "" + + " val2" + + "" + + + "" + + " " + + " " + + " resources" + + " true" + + " " + + " " + + ""); + compileModules("project"); + assertResult("target/classes/file.properties", "value=val2"); + } + + public void testUpdatingWhenPropertiesInModelAreChanged() throws Exception { + createProjectSubFile("resources/file.properties", "value=${project.name}"); + + importProject("test" + + "project" + + "1" + + + "val1" + + + "" + + " " + + " " + + " resources" + + " true" + + " " + + " " + + ""); + compileModules("project"); + assertResult("target/classes/file.properties", "value=val1"); + + importProject("test" + + "project" + + "1" + + + "val2" + + + "" + + " " + + " " + + " resources" + + " true" + + " " + + " " + + ""); + compileModules("project"); + assertResult("target/classes/file.properties", "value=val2"); + } + + public void testUpdatingWhenProfilesAreChanged() throws Exception { + createProjectSubFile("resources/file.properties", "value=${foo}"); + + createProjectPom("test" + + "project" + + "1" + + + "" + + " " + + " one" + + " " + + " val1" + + " " + + " " + + " " + + " two" + + " " + + " val2" + + " " + + " " + + "" + + + "" + + " " + + " " + + " resources" + + " true" + + " " + + " " + + ""); + importProjectWithProfiles("one"); + compileModules("project"); + assertResult("target/classes/file.properties", "value=val1"); + + myProjectsManager.setActiveProfiles(Arrays.asList("two")); + scheduleResolveAll(); + resolveDependenciesAndImport(); + compileModules("project"); + assertResult("target/classes/file.properties", "value=val2"); + } + public void testSameFileInSourcesAndTestSources() throws Exception { createProjectSubFile("src/main/resources/file.properties", "foo=${foo.main}"); createProjectSubFile("src/test/resources/file.properties", "foo=${foo.test}"); From 80af1a1bc202e1d017da816b38a71fc435476434 Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Fri, 18 Dec 2009 17:15:08 +0300 Subject: [PATCH 3/9] IDEADEV-41970 Notifications Options controls are responsible only by DblClick --- .../impl/ui/NotificationsConfigurablePanel.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/notification/impl/ui/NotificationsConfigurablePanel.java b/platform/platform-impl/src/com/intellij/notification/impl/ui/NotificationsConfigurablePanel.java index 1c8b7974521a..0eea82a24e77 100644 --- a/platform/platform-impl/src/com/intellij/notification/impl/ui/NotificationsConfigurablePanel.java +++ b/platform/platform-impl/src/com/intellij/notification/impl/ui/NotificationsConfigurablePanel.java @@ -29,7 +29,9 @@ import javax.swing.table.TableColumn; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; +import java.awt.event.MouseEvent; import java.util.ArrayList; +import java.util.EventObject; import java.util.Iterator; import java.util.List; @@ -111,6 +113,15 @@ public class NotificationsConfigurablePanel extends JPanel implements Disposable }); displayTypeColumn.setCellEditor(new ComboBoxTableRenderer(NotificationDisplayType.values()) { + @Override + public boolean isCellEditable(EventObject event) { + if (event instanceof MouseEvent) { + return ((MouseEvent)event).getClickCount() >= 1; + } + + return false; + } + @Override protected String getTextFor(@NotNull NotificationDisplayType value) { return value.getTitle(); From a3277f0efb9082d0fd0f8dfe728f864563c76ae6 Mon Sep 17 00:00:00 2001 From: Alexey Pegov Date: Fri, 18 Dec 2009 17:27:37 +0300 Subject: [PATCH 4/9] IDEADEV-41971 Clicking background tasks icon (on status bar) doesn't hide window --- .../impl/ui/NotificationComponent.java | 16 ++++++++-------- .../wm/impl/status/InfoAndProgressPanel.java | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/notification/impl/ui/NotificationComponent.java b/platform/platform-impl/src/com/intellij/notification/impl/ui/NotificationComponent.java index 7ebddd53d6ca..220e049e3061 100644 --- a/platform/platform-impl/src/com/intellij/notification/impl/ui/NotificationComponent.java +++ b/platform/platform-impl/src/com/intellij/notification/impl/ui/NotificationComponent.java @@ -57,7 +57,7 @@ public class NotificationComponent extends JLabel implements NotificationModelLi @Override public void mousePressed(final MouseEvent e) { if (UIUtil.isActionClick(e)) { - showList(); + toggleList(); } } }); @@ -97,16 +97,16 @@ public class NotificationComponent extends JLabel implements NotificationModelLi getManager().addListener(this); } - private void showList() { + private void toggleList() { + JBPopup popup = null; if (myPopupRef != null) { - final JBPopup popup = myPopupRef.get(); - if (popup != null && !popup.isVisible()) { - myPopupRef = null; - } - else if (popup == null) myPopupRef = null; + popup = myPopupRef.get(); + myPopupRef = null; } - if (myPopupRef == null) { + if (popup != null && popup.isVisible()) { + popup.cancel(); + } else { myPopupRef = new WeakReference(NotificationsListPanel.show(getProject(), this)); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java index c0f79ded8f58..188f00b54b80 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java @@ -86,6 +86,8 @@ public class InfoAndProgressPanel extends JPanel implements StatusBarPatch { public void mousePressed(MouseEvent e) { if (!myPopup.isShowing()) { openProcessPopup(); + } else { + hideProcessPopup(); } } }); From 85ced7fef505894ceb492d006aee42bdf7f3564a Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 18 Dec 2009 20:40:31 +0300 Subject: [PATCH 5/9] allow dangling lbrace in Ruby 1.9 regular expressions (RUBY-5505) --- .../org/intellij/lang/regexp/RegExpFile.java | 5 +- .../org/intellij/lang/regexp/RegExpLexer.java | 6 +- .../intellij/lang/regexp/RegExpParser.java | 25 +++++-- .../lang/regexp/RegExpParserDefinition.java | 8 +- .../org/intellij/lang/regexp/_RegExLexer.java | 73 ++++++++++--------- .../intellij/lang/regexp/regexp-lexer.flex | 14 +++- 6 files changed, 78 insertions(+), 53 deletions(-) diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpFile.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpFile.java index 9b5afbc2877c..298e1c663a34 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpFile.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpFile.java @@ -16,14 +16,15 @@ package org.intellij.lang.regexp; import com.intellij.extapi.psi.PsiFileBase; +import com.intellij.lang.Language; import com.intellij.openapi.fileTypes.FileType; import com.intellij.psi.FileViewProvider; import org.jetbrains.annotations.NotNull; public class RegExpFile extends PsiFileBase { - public RegExpFile(FileViewProvider viewProvider) { - super(viewProvider, RegExpLanguage.INSTANCE); + public RegExpFile(FileViewProvider viewProvider, final Language language) { + super(viewProvider, language); } @NotNull diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpLexer.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpLexer.java index 03773f7d4f7f..82642e336963 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpLexer.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpLexer.java @@ -17,12 +17,12 @@ package org.intellij.lang.regexp; import com.intellij.lexer.FlexAdapter; -class RegExpLexer extends FlexAdapter { +public class RegExpLexer extends FlexAdapter { private static final int COMMENT_MODE = 1 << 14; - public RegExpLexer(boolean xmlSchemaMode) { - super(new _RegExLexer(xmlSchemaMode)); + public RegExpLexer(boolean xmlSchemaMode, boolean allowDanglingMetacharacters) { + super(new _RegExLexer(xmlSchemaMode, allowDanglingMetacharacters)); } public void start(CharSequence buffer, int startOffset, int endOffset, int initialState) { diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java index 4785d1759251..b8497416ba6b 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java @@ -18,13 +18,19 @@ package org.intellij.lang.regexp; import com.intellij.lang.ASTNode; import com.intellij.lang.PsiBuilder; import com.intellij.lang.PsiParser; -import com.intellij.psi.tree.IElementType; import com.intellij.psi.StringEscapesTokenTypes; +import com.intellij.psi.tree.IElementType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @SuppressWarnings({ "RedundantIfStatement" }) -class RegExpParser implements PsiParser { +public class RegExpParser implements PsiParser { + private boolean myAllowDanglingMetacharacters; + + public void setAllowDanglingMetacharacters(boolean allowDanglingMetacharacters) { + myAllowDanglingMetacharacters = allowDanglingMetacharacters; + } + @NotNull public ASTNode parse(IElementType root, PsiBuilder builder) { // builder.setDebugMode(true); @@ -123,6 +129,10 @@ class RegExpParser implements PsiParser { if (builder.getTokenType() == RegExpTT.LBRACE) { builder.advanceLexer(); + if (builder.getTokenType() != RegExpTT.NUMBER && myAllowDanglingMetacharacters) { + marker.done(RegExpTT.CHARACTER); + return true; + } checkMatches(builder, RegExpTT.NUMBER, "Number expected"); if (builder.getTokenType() == RegExpTT.RBRACE) { builder.advanceLexer(); @@ -157,7 +167,7 @@ class RegExpParser implements PsiParser { return true; } - private void parseQuantifierType(PsiBuilder builder) { + private static void parseQuantifierType(PsiBuilder builder) { if (builder.getTokenType() == RegExpTT.PLUS) { builder.advanceLexer(); } else if (builder.getTokenType() == RegExpTT.QUEST) { @@ -344,14 +354,19 @@ class RegExpParser implements PsiParser { } else if (type == RegExpTT.CLASS_BEGIN) { marker.drop(); return parseClass(builder); - } else { + } + else if (type == RegExpTT.LBRACE && myAllowDanglingMetacharacters) { + builder.advanceLexer(); + marker.done(RegExpElementTypes.CHAR); + } + else { marker.drop(); return null; } return marker; } - private void parseProperty(PsiBuilder builder) { + private static void parseProperty(PsiBuilder builder) { checkMatches(builder, RegExpTT.PROPERTY, "'\\p' expected"); checkMatches(builder, RegExpTT.LBRACE, "Character category expected"); diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpParserDefinition.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpParserDefinition.java index 5ff73845191e..95f9100736f1 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpParserDefinition.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpParserDefinition.java @@ -34,9 +34,9 @@ import org.jetbrains.annotations.NotNull; public class RegExpParserDefinition implements ParserDefinition { private static final TokenSet COMMENT_TOKENS = TokenSet.create(RegExpTT.COMMENT); - @NotNull + @NotNull public Lexer createLexer(Project project) { - return new RegExpLexer(false); + return new RegExpLexer(false, false); } public PsiParser createParser(Project project) { @@ -86,7 +86,7 @@ public class RegExpParserDefinition implements ParserDefinition { return new RegExpSetOptionsImpl(node); } else if (type == RegExpElementTypes.OPTIONS) { return new RegExpOptionsImpl(node); - } else if (type == RegExpElementTypes.BACKREF) { + } else if (type == RegExpElementTypes.BACKREF) { return new RegExpBackrefImpl(node); } else if (type == RegExpElementTypes.CLOSURE) { return new RegExpClosureImpl(node); @@ -101,7 +101,7 @@ public class RegExpParserDefinition implements ParserDefinition { } public PsiFile createFile(FileViewProvider viewProvider) { - return new RegExpFile(viewProvider); + return new RegExpFile(viewProvider, RegExpLanguage.INSTANCE); } public SpaceRequirements spaceExistanceTypeBetweenTokens(ASTNode left, ASTNode right) { diff --git a/RegExpSupport/src/org/intellij/lang/regexp/_RegExLexer.java b/RegExpSupport/src/org/intellij/lang/regexp/_RegExLexer.java index 89ccdee550b8..8de1c26644c5 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/_RegExLexer.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/_RegExLexer.java @@ -1,26 +1,13 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* The following code was generated by JFlex 1.4.1 on 18.12.09 20:27 */ /* It's an automatically generated code. Do not modify it. */ package org.intellij.lang.regexp; import com.intellij.lexer.FlexLexer; -import com.intellij.psi.tree.IElementType; -import java.util.LinkedList; import com.intellij.psi.StringEscapesTokenTypes; +import com.intellij.psi.tree.IElementType; + +import java.util.LinkedList; // IDEADEV-11055 @SuppressWarnings({ "ALL", "SameParameterValue", "WeakerAccess", "SameReturnValue", "RedundantThrows", "UnusedDeclaration", "UnusedDeclaration" }) @@ -28,8 +15,8 @@ import com.intellij.psi.StringEscapesTokenTypes; /** * This class is a scanner generated by * JFlex 1.4.1 - * on 04.11.09 17:54 from the specification file - * RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex + * on 18.12.09 20:27 from the specification file + * C:/JetBrains/IDEA/tools/lexer/../../community/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex */ class _RegExLexer implements FlexLexer { /** initial size of the lookahead buffer */ @@ -352,9 +339,12 @@ class _RegExLexer implements FlexLexer { // as well, but is currently unfinished as it requires to tweak more places than just the lexer. private boolean xmlSchemaMode; - _RegExLexer(boolean xmlSchemaMode) { + private boolean allowDanglingMetacharacters; + + _RegExLexer(boolean xmlSchemaMode, boolean allowDanglingMetacharacters) { this((java.io.Reader)null); - this.xmlSchemaMode = xmlSchemaMode; + this.xmlSchemaMode = xmlSchemaMode; + this.allowDanglingMetacharacters = allowDanglingMetacharacters; } private void yypushstate(int state) { @@ -431,7 +421,14 @@ class _RegExLexer implements FlexLexer { // For Demetra compatibility public void reset(CharSequence buffer, int initialState){ - reset(buffer, 0, buffer.length(), initialState); + zzBuffer = buffer; + zzBufferArray = null; + zzCurrentPos = zzMarkedPos = zzStartRead = 0; + zzPushbackPos = 0; + zzAtEOF = false; + zzAtBOL = true; + zzEndRead = buffer.length(); + yybegin(initialState); } /** @@ -591,7 +588,7 @@ class _RegExLexer implements FlexLexer { while (true) { if (zzCurrentPosL < zzEndReadL) - zzInput = zzBufferL.charAt(zzCurrentPosL++); + zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++); else if (zzAtEOF) { zzInput = YYEOF; break zzForAction; @@ -613,7 +610,7 @@ class _RegExLexer implements FlexLexer { break zzForAction; } else { - zzInput = zzBufferL.charAt(zzCurrentPosL++); + zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++); } } int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; @@ -840,45 +837,49 @@ class _RegExLexer implements FlexLexer { { return RegExpTT.HEX_CHAR; } case 111: break; - case 20: - { return RegExpTT.BAD_CHARACTER; - } - case 112: break; case 5: { return RegExpTT.GROUP_BEGIN; } - case 113: break; + case 112: break; case 8: { yypushstate(CLASS2); return RegExpTT.CLASS_BEGIN; } - case 114: break; + case 113: break; case 52: { return RegExpTT.NON_CAPT_GROUP; } - case 115: break; + case 114: break; case 9: { return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; } - case 116: break; + case 115: break; case 48: { return RegExpTT.BAD_HEX_VALUE; } - case 117: break; + case 116: break; case 2: { yypopstate(); return RegExpTT.COMMENT; } - case 118: break; + case 117: break; case 47: { yypushstate(QUOTED); return RegExpTT.QUOTE_BEGIN; } - case 119: break; + case 118: break; case 26: { yybegin(CLASS2); return RegExpTT.CHARACTER; } - case 120: break; + case 119: break; case 15: { return RegExpTT.PLUS; } + case 120: break; + case 20: + { if (allowDanglingMetacharacters) { + yypopstate(); yypushback(1); + } else { + return RegExpTT.BAD_CHARACTER; + } + } case 121: break; case 31: { yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER; diff --git a/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex b/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex index dcd94c284ed0..621fc89cf6e6 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex +++ b/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex @@ -26,9 +26,12 @@ import com.intellij.psi.StringEscapesTokenTypes; // as well, but is currently unfinished as it requires to tweak more places than just the lexer. private boolean xmlSchemaMode; - _RegExLexer(boolean xmlSchemaMode) { + private boolean allowDanglingMetacharacters; + + _RegExLexer(boolean xmlSchemaMode, boolean allowDanglingMetacharacters) { this((java.io.Reader)null); - this.xmlSchemaMode = xmlSchemaMode; + this.xmlSchemaMode = xmlSchemaMode; + this.allowDanglingMetacharacters = allowDanglingMetacharacters; } private void yypushstate(int state) { @@ -157,7 +160,12 @@ HEX_CHAR=[0-9a-fA-F] "," { return RegExpTT.COMMA; } {RBRACE} { yypopstate(); return RegExpTT.RBRACE; } - {ANY} { return RegExpTT.BAD_CHARACTER; } + {ANY} { if (allowDanglingMetacharacters) { + yypopstate(); yypushback(1); + } else { + return RegExpTT.BAD_CHARACTER; + } + } } "-" { return RegExpTT.MINUS; } From 579c545220d71bda2ec012aabcd51ac957ed796a Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 18 Dec 2009 14:30:42 +0300 Subject: [PATCH 6/9] do not use default reporters by default --- .../configuration/TestNGConfigurationEditor.form | 11 +++++++++++ .../configuration/TestNGConfigurationEditor.java | 4 ++++ .../testng/configuration/TestNGRunnableState.java | 2 ++ .../com/theoryinpractice/testng/model/TestData.java | 9 +++++++-- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.form b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.form index 624b3c10e24b..3fe747cfff27 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.form +++ b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.form @@ -282,6 +282,8 @@ + + @@ -354,6 +356,15 @@ + + + + + + + + + diff --git a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java index beff36b2da04..f2fb3b7bfff4 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java +++ b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java @@ -96,6 +96,7 @@ public class TestNGConfigurationEditor extends SettingsEditor annotationType; + private JCheckBox myUseDefaultReportersCheckBox; private final CommonJavaParameters commonJavaParameters = new CommonJavaParameters(); private ArrayList propertiesList; private TestNGListenersTableModel listenerModel; @@ -230,6 +231,7 @@ public class TestNGConfigurationEditor extends SettingsEditor TEST_PROPERTIES = new HashMap(); public List TEST_LISTENERS = new ArrayList(); + public boolean USE_DEFAULT_REPORTERS = false; public String PROPERTIES_FILE; public TestData() { @@ -111,7 +112,8 @@ public class TestData implements Cloneable && Comparing.equal(WORKING_DIRECTORY, data.WORKING_DIRECTORY) && Comparing.equal(OUTPUT_DIRECTORY, data.OUTPUT_DIRECTORY) && Comparing.equal(VM_PARAMETERS, data.VM_PARAMETERS) - && Comparing.equal(PARAMETERS, data.PARAMETERS); + && Comparing.equal(PARAMETERS, data.PARAMETERS) + && USE_DEFAULT_REPORTERS == data.USE_DEFAULT_REPORTERS; } } @@ -125,7 +127,8 @@ public class TestData implements Cloneable Comparing.hashcode(WORKING_DIRECTORY) ^ Comparing.hashcode(OUTPUT_DIRECTORY) ^ Comparing.hashcode(VM_PARAMETERS) ^ - Comparing.hashcode(PARAMETERS); + Comparing.hashcode(PARAMETERS) ^ + Comparing.hashcode(USE_DEFAULT_REPORTERS); } @Override @@ -139,6 +142,8 @@ public class TestData implements Cloneable data.TEST_LISTENERS = new ArrayList(); data.TEST_LISTENERS.addAll(TEST_LISTENERS); + data.USE_DEFAULT_REPORTERS = USE_DEFAULT_REPORTERS; + data.setScope(getScope()); return data; } From 4a794ec8cbf2e66589b1a66ab776c7ecbc2efbf6 Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 18 Dec 2009 14:31:32 +0300 Subject: [PATCH 7/9] check if user scope name equals to default one --- .../ScopeChooserConfigurable.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeChooserConfigurable.java b/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeChooserConfigurable.java index 5b703b80f650..a18e67007092 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeChooserConfigurable.java +++ b/platform/lang-impl/src/com/intellij/ide/util/scopeChooser/ScopeChooserConfigurable.java @@ -33,10 +33,7 @@ import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.IconLoader; import com.intellij.packageDependencies.DependencyValidationManager; -import com.intellij.psi.search.scope.packageSet.NamedScope; -import com.intellij.psi.search.scope.packageSet.NamedScopeManager; -import com.intellij.psi.search.scope.packageSet.NamedScopesHolder; -import com.intellij.psi.search.scope.packageSet.PackageSet; +import com.intellij.psi.search.scope.packageSet.*; import com.intellij.ui.TreeSpeedSearch; import com.intellij.util.Icons; import com.intellij.util.containers.Convertor; @@ -126,6 +123,28 @@ public class ScopeChooserConfigurable extends MasterDetailsComponent implements loadStateOrder(); } + @Override + protected void checkApply(Set rootNodes, String prefix, String title) throws ConfigurationException { + super.checkApply(rootNodes, prefix, title); + final Set predefinedScopes = new HashSet(); + for (CustomScopesProvider scopesProvider : myProject.getExtensions(CustomScopesProvider.CUSTOM_SCOPES_PROVIDER)) { + for (NamedScope namedScope : scopesProvider.getCustomScopes()) { + predefinedScopes.add(namedScope.getName()); + } + } + for (MyNode rootNode : rootNodes) { + for (int i = 0; i < rootNode.getChildCount(); i++) { + final MyNode node = (MyNode)rootNode.getChildAt(i); + final NamedConfigurable scopeConfigurable = node.getConfigurable(); + final String name = scopeConfigurable.getDisplayName(); + if (predefinedScopes.contains(name)) { + selectNodeInTree(node); + throw new ConfigurationException("Scope name equals to predefined one", ProjectBundle.message("rename.scope.title")); + } + } + } + } + @Override protected PersistentStateComponent getAdditionalSettings() { return myScopesState; From e1b697f641aae1b2f315d10b968bd965f4f5f720 Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 18 Dec 2009 21:51:58 +0300 Subject: [PATCH 8/9] eclipse: import single .project; setup compiler output by default; store source paths inside zip in .eml while .classpath contains zip path --- .../EclipseClasspathStorageProvider.java | 26 +- .../conversion/EclipseClasspathReader.java | 117 +------ .../conversion/EclipseClasspathWriter.java | 107 ------- .../conversion/IdeaSpecificSettings.java | 297 ++++++++++++++++++ .../export/ExportEclipseProjectsAction.java | 7 +- .../importWizard/EclipseImportBuilder.java | 4 +- .../testData/eml/srcInZip/test/.classpath | 6 + .../testData/eml/srcInZip/test/.project | 16 + .../eml/srcInZip/test/lib/jar-all-5.zip | Bin 0 -> 33655 bytes .../testData/eml/srcInZip/test/srcInZip.eml | 11 + .../idea/eclipse/EclipseEmlTest.java | 118 +++++++ 11 files changed, 471 insertions(+), 238 deletions(-) create mode 100644 plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java create mode 100644 plugins/eclipse/testData/eml/srcInZip/test/.classpath create mode 100644 plugins/eclipse/testData/eml/srcInZip/test/.project create mode 100644 plugins/eclipse/testData/eml/srcInZip/test/lib/jar-all-5.zip create mode 100644 plugins/eclipse/testData/eml/srcInZip/test/srcInZip.eml create mode 100644 plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java index ac569f7acc0c..8668f3876f42 100644 --- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java @@ -36,10 +36,7 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.idea.eclipse.EclipseBundle; import org.jetbrains.idea.eclipse.EclipseXml; import org.jetbrains.idea.eclipse.IdeaXml; -import org.jetbrains.idea.eclipse.conversion.ConversionException; -import org.jetbrains.idea.eclipse.conversion.DotProjectFileHelper; -import org.jetbrains.idea.eclipse.conversion.EclipseClasspathReader; -import org.jetbrains.idea.eclipse.conversion.EclipseClasspathWriter; +import org.jetbrains.idea.eclipse.conversion.*; import java.io.File; import java.io.IOException; @@ -70,8 +67,6 @@ public class EclipseClasspathStorageProvider implements ClasspathStorageProvider final Library library = ((LibraryOrderEntry)entry).getLibrary(); if (library == null || entry.getUrls(OrderRootType.CLASSES).length != 1 || - entry.getUrls(OrderRootType.SOURCES).length > 1 || - entry.getUrls(JavadocOrderRootType.getInstance()).length > 1 || library.isJarDirectory(library.getUrls(OrderRootType.CLASSES)[0])) { throw new ConfigurationException( "Library \'" + entry.getPresentableName() + "\' is incompatible with eclipse format which supports only one content root"); @@ -98,7 +93,7 @@ public class EclipseClasspathStorageProvider implements ClasspathStorageProvider return new EclipseClasspathConverter(module); } - static void registerFiles(final CachedXmlDocumentSet fileCache, final Module module, final String moduleRoot, final String storageRoot) { + public static void registerFiles(final CachedXmlDocumentSet fileCache, final Module module, final String moduleRoot, final String storageRoot) { fileCache.register(EclipseXml.CLASSPATH_FILE, storageRoot); fileCache.register(EclipseXml.PROJECT_FILE, storageRoot); fileCache.register(EclipseXml.PLUGIN_XML_FILE, storageRoot); @@ -171,15 +166,16 @@ public class EclipseClasspathStorageProvider implements ClasspathStorageProvider final EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, module.getProject(), null); classpathReader.init(model); if (documentSet.exists(EclipseXml.CLASSPATH_FILE)) { - classpathReader.readClasspath(model, new ArrayList(), new ArrayList(), usedVariables, new HashSet(), null, documentSet.read(EclipseXml.CLASSPATH_FILE).getRootElement()); - final String eml = model.getModule().getName() + EclipseXml.IDEA_SETTINGS_POSTFIX; - if (documentSet.exists(eml)) { - EclipseClasspathReader.readIDEASpecific(documentSet.read(eml).getRootElement(), model); - } else { - model.getModuleExtension(CompilerModuleExtension.class).setExcludeOutput(false); - } + } else { + EclipseClasspathReader.setupOutput(model, path + "/bin"); + } + final String eml = model.getModule().getName() + EclipseXml.IDEA_SETTINGS_POSTFIX; + if (documentSet.exists(eml)) { + IdeaSpecificSettings.readIDEASpecific(documentSet.read(eml).getRootElement(), model); + } else { + model.getModuleExtension(CompilerModuleExtension.class).setExcludeOutput(false); } ((RootModelImpl)model).writeExternal(element); @@ -224,7 +220,7 @@ public class EclipseClasspathStorageProvider implements ClasspathStorageProvider final Element ideaSpecific = new Element(IdeaXml.COMPONENT_TAG); final String emlFilename = model.getModule().getName() + EclipseXml.IDEA_SETTINGS_POSTFIX; - if (classpathWriter.writeIDEASpecificClasspath(ideaSpecific)) { + if (IdeaSpecificSettings.writeIDEASpecificClasspath(ideaSpecific, model)) { fileSet.write(new Document(ideaSpecific), emlFilename); } else { diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathReader.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathReader.java index 3a089d2144ae..10a203cf9696 100644 --- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathReader.java +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathReader.java @@ -32,9 +32,7 @@ import com.intellij.openapi.roots.libraries.Library; import com.intellij.openapi.roots.libraries.LibraryTable; import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar; import com.intellij.openapi.util.Comparing; -import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.SystemInfo; -import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.JarFileSystem; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; @@ -153,9 +151,7 @@ public class EclipseClasspathReader { } else if (kind.equals(EclipseXml.OUTPUT_KIND)) { - final CompilerModuleExtension compilerModuleExtension = rootModel.getModuleExtension(CompilerModuleExtension.class); - compilerModuleExtension.setCompilerOutputPath(VfsUtil.pathToUrl(myRootPath + "/" + path)); - compilerModuleExtension.inheritCompilerOutputPath(false); + setupOutput(rootModel, myRootPath + "/" + path); } else if (kind.equals(EclipseXml.LIB_KIND)) { @@ -277,6 +273,12 @@ public class EclipseClasspathReader { } } + public static void setupOutput(ModifiableRootModel rootModel, final String path) { + final CompilerModuleExtension compilerModuleExtension = rootModel.getModuleExtension(CompilerModuleExtension.class); + compilerModuleExtension.setCompilerOutputPath(VfsUtil.pathToUrl(path)); + compilerModuleExtension.inheritCompilerOutputPath(false); + } + private static void setLibraryEntryExported(ModifiableRootModel rootModel, boolean exported, Library library) { for (OrderEntry orderEntry : rootModel.getOrderEntries()) { if (orderEntry instanceof LibraryOrderEntry && @@ -485,109 +487,4 @@ public class EclipseClasspathReader { return url; } - public static void readIDEASpecific(final Element root, ModifiableRootModel model) throws InvalidDataException { - PathMacroManager.getInstance(model.getModule()).expandPaths(root); - - model.getModuleExtension(LanguageLevelModuleExtension.class).readExternal(root); - - final CompilerModuleExtension compilerModuleExtension = model.getModuleExtension(CompilerModuleExtension.class); - final Element testOutputElement = root.getChild(IdeaXml.OUTPUT_TEST_TAG); - if (testOutputElement != null) { - compilerModuleExtension.setCompilerOutputPathForTests(testOutputElement.getAttributeValue(IdeaXml.URL_ATTR)); - } - - final String inheritedOutput = root.getAttributeValue(IdeaXml.INHERIT_COMPILER_OUTPUT_ATTR); - if (inheritedOutput != null && Boolean.valueOf(inheritedOutput).booleanValue()) { - compilerModuleExtension.inheritCompilerOutputPath(true); - } - - compilerModuleExtension.setExcludeOutput(root.getChild(IdeaXml.EXCLUDE_OUTPUT_TAG) != null); - - final List entriesElements = root.getChildren(IdeaXml.CONTENT_ENTRY_TAG); - if (!entriesElements.isEmpty()) { - for (Object o : entriesElements) { - readContentEntry((Element)o, model.addContentEntry(((Element)o).getAttributeValue(IdeaXml.URL_ATTR))); - } - } else { - final ContentEntry[] entries = model.getContentEntries(); - if (entries.length > 0) { - readContentEntry(root, entries[0]); - } - } - - for (Object o : root.getChildren("lib")) { - Element libElement = (Element)o; - final String libName = libElement.getAttributeValue("name"); - final Library libraryByName = model.getModuleLibraryTable().getLibraryByName(libName); - if (libraryByName != null) { - final LibraryOrderEntry libraryOrderEntry = model.findLibraryOrderEntry(libraryByName); - if (libraryOrderEntry != null) { - final String scopeAttribute = libElement.getAttributeValue("scope"); - libraryOrderEntry.setScope(scopeAttribute == null ? DependencyScope.COMPILE : DependencyScope.valueOf(scopeAttribute)); - } - final Library.ModifiableModel modifiableModel = libraryByName.getModifiableModel(); - for (Object r : libElement.getChildren("srcroot")) { - modifiableModel.addRoot(((Element)r).getAttributeValue("url"), OrderRootType.SOURCES); - } - replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.SOURCES, "relative-module-src"); - replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.CLASSES, "relative-module-cls"); - modifiableModel.commit(); - } else { //try to replace everywhere - final Library[] libraries = model.getModuleLibraryTable().getLibraries(); - for (Library library : libraries) { - final Library.ModifiableModel modifiableModel = library.getModifiableModel(); - replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.SOURCES, "relative-module-src"); - replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.CLASSES, "relative-module-cls"); - modifiableModel.commit(); - } - } - } - } - - private static void replaceModuleRelatedRoots(final Project project, final Library.ModifiableModel modifiableModel, final Element libElement, - final OrderRootType orderRootType, final String relativeModuleName) { - final List urls = new ArrayList(Arrays.asList(modifiableModel.getUrls(orderRootType))); - for (Object r : libElement.getChildren(relativeModuleName)) { - final String root = PathMacroManager.getInstance(project).expandPath(((Element)r).getAttributeValue("project-related")); - for (Iterator iterator = urls.iterator(); iterator.hasNext();) { - String url = iterator.next(); - if (root.contains(VfsUtil.urlToPath(url))) { - iterator.remove(); - modifiableModel.removeRoot(url, orderRootType); - modifiableModel.addRoot(root, orderRootType); - break; - } - } - } - } - - private static void readContentEntry(Element root, ContentEntry entry) { - for (Object o : root.getChildren(IdeaXml.TEST_FOLDER_TAG)) { - final String url = ((Element)o).getAttributeValue(IdeaXml.URL_ATTR); - SourceFolder folderToBeTest = null; - for (SourceFolder folder : entry.getSourceFolders()) { - if (Comparing.strEqual(folder.getUrl(), url)) { - folderToBeTest = folder; - break; - } - } - if (folderToBeTest != null) { - entry.removeSourceFolder(folderToBeTest); - } - entry.addSourceFolder(url, true); - } - - final String url = entry.getUrl(); - for (Object o : root.getChildren(IdeaXml.EXCLUDE_FOLDER_TAG)) { - final String excludeUrl = ((Element)o).getAttributeValue(IdeaXml.URL_ATTR); - try { - if (FileUtil.isAncestor(new File(url), new File(excludeUrl), false)) { //check if it is excluded manually - entry.addExcludeFolder(excludeUrl); - } - } - catch (IOException e) { - //ignore - } - } - } } diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathWriter.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathWriter.java index 012a3915606a..cf71b7650dd5 100644 --- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathWriter.java +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseClasspathWriter.java @@ -30,7 +30,6 @@ import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.roots.*; import com.intellij.openapi.roots.impl.ProjectRootManagerImpl; import com.intellij.openapi.util.Comparing; -import com.intellij.openapi.util.WriteExternalException; import com.intellij.openapi.util.text.CharFilter; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.JarFileSystem; @@ -38,7 +37,6 @@ import com.intellij.openapi.vfs.VfsUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.openapi.vfs.ex.http.HttpFileSystem; -import com.intellij.pom.java.LanguageLevel; import org.jdom.Element; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.Nullable; @@ -309,111 +307,6 @@ public class EclipseClasspathWriter { return (leaveLeadingSlash ? "/" : "") + stripped; } - public boolean writeIDEASpecificClasspath(final Element root) throws WriteExternalException { - - boolean isModified = false; - - final CompilerModuleExtension compilerModuleExtension = myModel.getModuleExtension(CompilerModuleExtension.class); - - if (compilerModuleExtension.getCompilerOutputPathForTests() != null) { - final Element pathElement = new Element(IdeaXml.OUTPUT_TEST_TAG); - pathElement.setAttribute(IdeaXml.URL_ATTR, compilerModuleExtension.getCompilerOutputUrlForTests()); - root.addContent(pathElement); - isModified = true; - } - if (compilerModuleExtension.isCompilerOutputPathInherited()) { - root.setAttribute(IdeaXml.INHERIT_COMPILER_OUTPUT_ATTR, String.valueOf(true)); - isModified = true; - } - if (compilerModuleExtension.isExcludeOutput()) { - root.addContent(new Element(IdeaXml.EXCLUDE_OUTPUT_TAG)); - isModified = true; - } - - final LanguageLevelModuleExtension languageLevelModuleExtension = myModel.getModuleExtension(LanguageLevelModuleExtension.class); - final LanguageLevel languageLevel = languageLevelModuleExtension.getLanguageLevel(); - if (languageLevel != null) { - languageLevelModuleExtension.writeExternal(root); - isModified = true; - } - - for (ContentEntry entry : myModel.getContentEntries()) { - final Element contentEntryElement = new Element(IdeaXml.CONTENT_ENTRY_TAG); - contentEntryElement.setAttribute(IdeaXml.URL_ATTR, entry.getUrl()); - root.addContent(contentEntryElement); - for (SourceFolder sourceFolder : entry.getSourceFolders()) { - if (sourceFolder.isTestSource()) { - Element element = new Element(IdeaXml.TEST_FOLDER_TAG); - contentEntryElement.addContent(element); - element.setAttribute(IdeaXml.URL_ATTR, sourceFolder.getUrl()); - isModified = true; - } - } - - final VirtualFile entryFile = entry.getFile(); - for (ExcludeFolder excludeFolder : entry.getExcludeFolders()) { - final String exludeFolderUrl = excludeFolder.getUrl(); - final VirtualFile excludeFile = excludeFolder.getFile(); - if (entryFile == null || excludeFile == null || VfsUtil.isAncestor(entryFile, excludeFile, false)) { - Element element = new Element(IdeaXml.EXCLUDE_FOLDER_TAG); - contentEntryElement.addContent(element); - element.setAttribute(IdeaXml.URL_ATTR, exludeFolderUrl); - isModified = true; - } - } - } - - for (OrderEntry entry : myModel.getOrderEntries()) { - if (entry instanceof LibraryOrderEntry && ((LibraryOrderEntry)entry).isModuleLevel()) { - final Element element = new Element("lib"); - element.setAttribute("name", entry.getPresentableName()); - final DependencyScope scope = ((LibraryOrderEntry)entry).getScope(); - element.setAttribute("scope", scope.name()); - final String[] urls = entry.getUrls(OrderRootType.SOURCES); - if (urls.length > 1) { - for (int i = 0; i < urls.length - 1; i++) { - Element srcElement = new Element("srcroot"); - srcElement.setAttribute("url", urls[i]); - element.addContent(srcElement); - } - } - - for (String srcUrl : entry.getUrls(OrderRootType.SOURCES)) { - appendModuleRelatedRoot(element, srcUrl, "relative-module-src"); - } - for (String classesUrl : entry.getUrls(OrderRootType.CLASSES)) { - appendModuleRelatedRoot(element, classesUrl, "relative-module-cls"); - } - if (!element.getChildren().isEmpty() || !scope.equals(DependencyScope.COMPILE)) root.addContent(element); - } - } - - PathMacroManager.getInstance(myModel.getModule()).collapsePaths(root); - - return isModified; - } - - private boolean appendModuleRelatedRoot(Element element, String classesUrl, final String rootMame) { - VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(classesUrl); - if (file != null) { - if (file.getFileSystem() instanceof JarFileSystem) { - file = JarFileSystem.getInstance().getVirtualFileForJar(file); - assert file != null; - } - final Module module = ModuleUtil.findModuleForFile(file, myModel.getProject()); - if (module != null && module != myModel.getModule()) { - final VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots(); - if (contentRoots.length > 0 && VfsUtil.isAncestor(contentRoots[0], file, false)) { - final Element clsElement = new Element(rootMame); - clsElement.setAttribute("project-related", PathMacroManager.getInstance(module.getProject()).collapsePath(classesUrl)); - element.addContent(clsElement); - return true; - } - } - } - return false; - } - private static Element addOrderEntry(String kind, String path, Element classpathRoot, Element oldRoot) { if (oldRoot != null) { diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java new file mode 100644 index 000000000000..5d3ec44f1b26 --- /dev/null +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/IdeaSpecificSettings.java @@ -0,0 +1,297 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 18-Dec-2009 + */ +package org.jetbrains.idea.eclipse.conversion; + +import com.intellij.openapi.components.PathMacroManager; +import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleUtil; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.*; +import com.intellij.openapi.roots.libraries.Library; +import com.intellij.openapi.util.Comparing; +import com.intellij.openapi.util.InvalidDataException; +import com.intellij.openapi.util.WriteExternalException; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.JarFileSystem; +import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileManager; +import com.intellij.pom.java.LanguageLevel; +import org.jdom.Element; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.idea.eclipse.IdeaXml; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +/** + * Read/write .eml + */ +public class IdeaSpecificSettings { + @NonNls private static final String RELATIVE_MODULE_SRC = "relative-module-src"; + @NonNls private static final String RELATIVE_MODULE_CLS = "relative-module-cls"; + @NonNls private static final String PROJECT_RELATED = "project-related"; + @NonNls private static final String SRCROOT_ATTR = "srcroot"; + private static final Logger LOG = Logger.getInstance("#" + IdeaSpecificSettings.class.getName()); + + private IdeaSpecificSettings() { + } + + public static void readIDEASpecific(final Element root, ModifiableRootModel model) throws InvalidDataException { + PathMacroManager.getInstance(model.getModule()).expandPaths(root); + + model.getModuleExtension(LanguageLevelModuleExtension.class).readExternal(root); + + final CompilerModuleExtension compilerModuleExtension = model.getModuleExtension(CompilerModuleExtension.class); + final Element testOutputElement = root.getChild(IdeaXml.OUTPUT_TEST_TAG); + if (testOutputElement != null) { + compilerModuleExtension.setCompilerOutputPathForTests(testOutputElement.getAttributeValue(IdeaXml.URL_ATTR)); + } + + final String inheritedOutput = root.getAttributeValue(IdeaXml.INHERIT_COMPILER_OUTPUT_ATTR); + if (inheritedOutput != null && Boolean.valueOf(inheritedOutput).booleanValue()) { + compilerModuleExtension.inheritCompilerOutputPath(true); + } + + compilerModuleExtension.setExcludeOutput(root.getChild(IdeaXml.EXCLUDE_OUTPUT_TAG) != null); + + final List entriesElements = root.getChildren(IdeaXml.CONTENT_ENTRY_TAG); + if (!entriesElements.isEmpty()) { + for (Object o : entriesElements) { + readContentEntry((Element)o, model.addContentEntry(((Element)o).getAttributeValue(IdeaXml.URL_ATTR))); + } + } else { + final ContentEntry[] entries = model.getContentEntries(); + if (entries.length > 0) { + readContentEntry(root, entries[0]); + } + } + + for (Object o : root.getChildren("lib")) { + Element libElement = (Element)o; + final String libName = libElement.getAttributeValue("name"); + final Library libraryByName = model.getModuleLibraryTable().getLibraryByName(libName); + if (libraryByName != null) { + final LibraryOrderEntry libraryOrderEntry = model.findLibraryOrderEntry(libraryByName); + if (libraryOrderEntry != null) { + final String scopeAttribute = libElement.getAttributeValue("scope"); + libraryOrderEntry.setScope(scopeAttribute == null ? DependencyScope.COMPILE : DependencyScope.valueOf(scopeAttribute)); + } + final Library.ModifiableModel modifiableModel = libraryByName.getModifiableModel(); + replaceCollapsedByEclipseSourceRoots(libElement, modifiableModel); + replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.SOURCES, RELATIVE_MODULE_SRC); + replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.CLASSES, RELATIVE_MODULE_CLS); + modifiableModel.commit(); + } else { //try to replace everywhere + final Library[] libraries = model.getModuleLibraryTable().getLibraries(); + for (Library library : libraries) { + final Library.ModifiableModel modifiableModel = library.getModifiableModel(); + replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.SOURCES, RELATIVE_MODULE_SRC); + replaceModuleRelatedRoots(model.getProject(), modifiableModel, libElement, OrderRootType.CLASSES, RELATIVE_MODULE_CLS); + modifiableModel.commit(); + } + } + } + } + + /** + * Eclipse detect sources inside zip automatically while IDEA doesn't. + * So .eml contains expanded roots which should replace zip root read from .classpath + */ + private static void replaceCollapsedByEclipseSourceRoots(Element libElement, Library.ModifiableModel modifiableModel) { + String[] srcUrlsFromClasspath = modifiableModel.getUrls(OrderRootType.SOURCES); + LOG.assertTrue(srcUrlsFromClasspath.length <= 1); + for (Object r : libElement.getChildren(SRCROOT_ATTR)) { + final String url = ((Element)r).getAttributeValue("url"); + modifiableModel.addRoot(url, OrderRootType.SOURCES); + if (srcUrlsFromClasspath != null && srcUrlsFromClasspath.length == 1 && url.contains(VfsUtil.urlToPath(srcUrlsFromClasspath[0]))) { //remove compound root + modifiableModel.removeRoot(srcUrlsFromClasspath[0], OrderRootType.SOURCES); + srcUrlsFromClasspath = null; + } + } + } + + public static void replaceModuleRelatedRoots(final Project project, + final Library.ModifiableModel modifiableModel, final Element libElement, + final OrderRootType orderRootType, final String relativeModuleName) { + final List urls = new ArrayList(Arrays.asList(modifiableModel.getUrls(orderRootType))); + for (Object r : libElement.getChildren(relativeModuleName)) { + final String root = PathMacroManager.getInstance(project).expandPath(((Element)r).getAttributeValue(PROJECT_RELATED)); + for (Iterator iterator = urls.iterator(); iterator.hasNext();) { + String url = iterator.next(); + if (root.contains(VfsUtil.urlToPath(url))) { + iterator.remove(); + modifiableModel.removeRoot(url, orderRootType); + modifiableModel.addRoot(root, orderRootType); + break; + } + } + } + } + + public static void readContentEntry(Element root, ContentEntry entry) { + for (Object o : root.getChildren(IdeaXml.TEST_FOLDER_TAG)) { + final String url = ((Element)o).getAttributeValue(IdeaXml.URL_ATTR); + SourceFolder folderToBeTest = null; + for (SourceFolder folder : entry.getSourceFolders()) { + if (Comparing.strEqual(folder.getUrl(), url)) { + folderToBeTest = folder; + break; + } + } + if (folderToBeTest != null) { + entry.removeSourceFolder(folderToBeTest); + } + entry.addSourceFolder(url, true); + } + + final String url = entry.getUrl(); + for (Object o : root.getChildren(IdeaXml.EXCLUDE_FOLDER_TAG)) { + final String excludeUrl = ((Element)o).getAttributeValue(IdeaXml.URL_ATTR); + try { + if (FileUtil.isAncestor(new File(url), new File(excludeUrl), false)) { //check if it is excluded manually + entry.addExcludeFolder(excludeUrl); + } + } + catch (IOException e) { + //ignore + } + } + } + + public static boolean writeIDEASpecificClasspath(final Element root, ModifiableRootModel model) throws WriteExternalException { + + boolean isModified = false; + + final CompilerModuleExtension compilerModuleExtension = model.getModuleExtension(CompilerModuleExtension.class); + + if (compilerModuleExtension.getCompilerOutputPathForTests() != null) { + final Element pathElement = new Element(IdeaXml.OUTPUT_TEST_TAG); + pathElement.setAttribute(IdeaXml.URL_ATTR, compilerModuleExtension.getCompilerOutputUrlForTests()); + root.addContent(pathElement); + isModified = true; + } + if (compilerModuleExtension.isCompilerOutputPathInherited()) { + root.setAttribute(IdeaXml.INHERIT_COMPILER_OUTPUT_ATTR, String.valueOf(true)); + isModified = true; + } + if (compilerModuleExtension.isExcludeOutput()) { + root.addContent(new Element(IdeaXml.EXCLUDE_OUTPUT_TAG)); + isModified = true; + } + + final LanguageLevelModuleExtension languageLevelModuleExtension = model.getModuleExtension(LanguageLevelModuleExtension.class); + final LanguageLevel languageLevel = languageLevelModuleExtension.getLanguageLevel(); + if (languageLevel != null) { + languageLevelModuleExtension.writeExternal(root); + isModified = true; + } + + for (ContentEntry entry : model.getContentEntries()) { + final Element contentEntryElement = new Element(IdeaXml.CONTENT_ENTRY_TAG); + contentEntryElement.setAttribute(IdeaXml.URL_ATTR, entry.getUrl()); + root.addContent(contentEntryElement); + for (SourceFolder sourceFolder : entry.getSourceFolders()) { + if (sourceFolder.isTestSource()) { + Element element = new Element(IdeaXml.TEST_FOLDER_TAG); + contentEntryElement.addContent(element); + element.setAttribute(IdeaXml.URL_ATTR, sourceFolder.getUrl()); + isModified = true; + } + } + + final VirtualFile entryFile = entry.getFile(); + for (ExcludeFolder excludeFolder : entry.getExcludeFolders()) { + final String exludeFolderUrl = excludeFolder.getUrl(); + final VirtualFile excludeFile = excludeFolder.getFile(); + if (entryFile == null || excludeFile == null || VfsUtil.isAncestor(entryFile, excludeFile, false)) { + Element element = new Element(IdeaXml.EXCLUDE_FOLDER_TAG); + contentEntryElement.addContent(element); + element.setAttribute(IdeaXml.URL_ATTR, exludeFolderUrl); + isModified = true; + } + } + } + + for (OrderEntry entry : model.getOrderEntries()) { + if (entry instanceof LibraryOrderEntry && ((LibraryOrderEntry)entry).isModuleLevel()) { + final Element element = new Element("lib"); + element.setAttribute("name", entry.getPresentableName()); + final DependencyScope scope = ((LibraryOrderEntry)entry).getScope(); + element.setAttribute("scope", scope.name()); + final String[] urls = entry.getUrls(OrderRootType.SOURCES); + if (urls.length > 1) { + for (int i = 0; i < urls.length - 1; i++) { + Element srcElement = new Element(SRCROOT_ATTR); + srcElement.setAttribute("url", urls[i]); + element.addContent(srcElement); + } + } + else if (urls.length == 1 && urls[0].contains(JarFileSystem.JAR_SEPARATOR)) { + final VirtualFile virtualFile = JarFileSystem.getInstance().findFileByPath(VfsUtil.urlToPath(urls[0])); + if (virtualFile != null) { + Element srcElement = new Element(SRCROOT_ATTR); + srcElement.setAttribute("url", urls[0]); + element.addContent(srcElement); + } + } + + for (String srcUrl : entry.getUrls(OrderRootType.SOURCES)) { + appendModuleRelatedRoot(element, srcUrl, RELATIVE_MODULE_SRC, model); + } + for (String classesUrl : entry.getUrls(OrderRootType.CLASSES)) { + appendModuleRelatedRoot(element, classesUrl, RELATIVE_MODULE_CLS, model); + } + if (!element.getChildren().isEmpty() || !scope.equals(DependencyScope.COMPILE)) root.addContent(element); + } + } + + PathMacroManager.getInstance(model.getModule()).collapsePaths(root); + + return isModified; + } + + public static boolean appendModuleRelatedRoot(Element element, String classesUrl, final String rootMame, ModifiableRootModel model) { + VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(classesUrl); + if (file != null) { + if (file.getFileSystem() instanceof JarFileSystem) { + file = JarFileSystem.getInstance().getVirtualFileForJar(file); + assert file != null; + } + final Module module = ModuleUtil.findModuleForFile(file, model.getProject()); + if (module != null && module != model.getModule()) { + final VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots(); + if (contentRoots.length > 0 && VfsUtil.isAncestor(contentRoots[0], file, false)) { + final Element clsElement = new Element(rootMame); + clsElement.setAttribute(PROJECT_RELATED, PathMacroManager.getInstance(module.getProject()).collapsePath(classesUrl)); + element.addContent(clsElement); + return true; + } + } + } + return false; + } +} \ No newline at end of file diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsAction.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsAction.java index 297c863e9a34..0b1f554a2006 100644 --- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsAction.java +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/export/ExportEclipseProjectsAction.java @@ -39,10 +39,7 @@ import org.jetbrains.idea.eclipse.EclipseBundle; import org.jetbrains.idea.eclipse.EclipseXml; import org.jetbrains.idea.eclipse.IdeaXml; import org.jetbrains.idea.eclipse.config.EclipseClasspathStorageProvider; -import org.jetbrains.idea.eclipse.conversion.ConversionException; -import org.jetbrains.idea.eclipse.conversion.DotProjectFileHelper; -import org.jetbrains.idea.eclipse.conversion.EclipseClasspathWriter; -import org.jetbrains.idea.eclipse.conversion.EclipseUserLibrariesHelper; +import org.jetbrains.idea.eclipse.conversion.*; import java.io.File; import java.io.IOException; @@ -115,7 +112,7 @@ public class ExportEclipseProjectsAction extends AnAction implements DumbAware { EclipseJDOMUtil.output(new Document(classpathEleemnt), classpathFile, project); final Element ideaSpecific = new Element(IdeaXml.COMPONENT_TAG); - if (classpathWriter.writeIDEASpecificClasspath(ideaSpecific)) { + if (IdeaSpecificSettings.writeIDEASpecificClasspath(ideaSpecific, model)) { final File emlFile = new File(storageRoot, module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX); if (!FileUtil.createIfDoesntExist(emlFile)) continue; EclipseJDOMUtil.output(new Document(ideaSpecific), emlFile, project); diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseImportBuilder.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseImportBuilder.java index c4359c29c00f..23c0da2aeb0b 100644 --- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseImportBuilder.java +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/importWizard/EclipseImportBuilder.java @@ -47,9 +47,9 @@ import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.packaging.artifacts.ModifiableArtifactModel; import com.intellij.projectImport.ProjectImportBuilder; import com.intellij.util.Function; -import com.intellij.packaging.artifacts.ModifiableArtifactModel; import org.jdom.Element; import org.jdom.JDOMException; import org.jetbrains.annotations.NotNull; @@ -264,6 +264,8 @@ public class EclipseImportBuilder extends ProjectImportBuilder implement final Element classpathElement = JDOMUtil.loadDocument(classpathFile).getRootElement(); classpathReader.readClasspath(rootModel, unknownLibraries, unknownJdks, usedVariables, refsToModules, getParameters().converterOptions.testPattern, classpathElement); + } else { + EclipseClasspathReader.setupOutput(rootModel, path + "/bin"); } ClasspathStorage.setStorageType(rootModel, getParameters().linkConverted ? EclipseClasspathStorageProvider.ID : ClasspathStorage.DEFAULT_STORAGE); diff --git a/plugins/eclipse/testData/eml/srcInZip/test/.classpath b/plugins/eclipse/testData/eml/srcInZip/test/.classpath new file mode 100644 index 000000000000..a4a768058976 --- /dev/null +++ b/plugins/eclipse/testData/eml/srcInZip/test/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/plugins/eclipse/testData/eml/srcInZip/test/.project b/plugins/eclipse/testData/eml/srcInZip/test/.project new file mode 100644 index 000000000000..ffcb70792087 --- /dev/null +++ b/plugins/eclipse/testData/eml/srcInZip/test/.project @@ -0,0 +1,16 @@ + + + srcInZip + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + + + diff --git a/plugins/eclipse/testData/eml/srcInZip/test/lib/jar-all-5.zip b/plugins/eclipse/testData/eml/srcInZip/test/lib/jar-all-5.zip new file mode 100644 index 0000000000000000000000000000000000000000..1c4f645ac0c7e631709a6ecc6e5212ac19aba0cc GIT binary patch literal 33655 zcmb5W19YU%zWp6dY}>}fwrxyo+qP}noY=M}o=iNkjfwH^`5nzU_q=!AH|trIURhO7 zx+~Q?pW6Fdtso5w1`YK4i?mFc>#qlYZ@>WGjqQx+75>?S0$Y4E@h%g!;!&3tM9ocREuGYZIsc zWd!mcBOFbf>|7j;{;mK1f4rLCvts>kPyauAApE_@e|@cYrT=r1ogDw1_PK-S6#BZLLeM><8r9fk@m?9I5r)JL;)saM##M$%0oXEiDg$wmelmInuHJ5fwO z@l{Ftgq^mWhv-y5SM&Kf+R@UW45sD8Knx~3OFE5TkPqcv{^hdyXhw(V^dG;6U0GkfUaeQ-o>k#1!~;oPcXJMD6a5R#wE*3BB>ZQ& zrp_UHX@qKSUnHDN>;D4t0*#?yJ#}k|9rmLPTRx;g)C+{hwo(M}&tQ zdI%}==D*Y5<1;ybWtf3%@c#0+wrIS+D)4p4M9J-qvxVcwO*=*e&sKxaajYSoUI_06 zCGoY0i8aI6{u*ysC?vUK6&Jo6vm@@(~zY#~FtI++JuMt;Em zc$@xhQ841gO3wop#VlY^5d5*k|5y~Zc7HAl9ji44R3Cyf{&i?@oWaz^jk zzr^cQg>plYqeKSlqe_09`@R`-YTX*@<#{>JaNhi~OC&b!gbP8NR9fZ{J>~-6)9=a| z#-yOlz;>$<_y5(Usx(=%4>!Uh?k}gwKf{P0+K*>yyF|c9b1j*d#l7yFgKS%E)%5r} z-s_O94U6N88q4e(r+l6jI$nZ+P>9C6R2cfk{d!Q_bpe0n@CDx%ULl`o%{FuuxII$Fwuw)abKu*XUur5AHM6t&pND-;0ID1Ul(^-;% zs>EEe*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LLCDcDH z<({D$UqJom!tN!;Kdlp+o1&sD=~u-CKWXRvFx|7)(SAPo-j^nMb+j|gBYiTgAI G1Nwi~OWZ{O literal 0 HcmV?d00001 diff --git a/plugins/eclipse/testData/eml/srcInZip/test/srcInZip.eml b/plugins/eclipse/testData/eml/srcInZip/test/srcInZip.eml new file mode 100644 index 000000000000..dd848dc722cd --- /dev/null +++ b/plugins/eclipse/testData/eml/srcInZip/test/srcInZip.eml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java new file mode 100644 index 000000000000..3375ee5a2921 --- /dev/null +++ b/plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseEmlTest.java @@ -0,0 +1,118 @@ +/* + * Copyright 2000-2009 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * User: anna + * Date: 28-Nov-2008 + */ +package org.jetbrains.idea.eclipse; + +import com.intellij.openapi.application.ApplicationManager; +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.roots.ModifiableRootModel; +import com.intellij.openapi.roots.ModuleRootManager; +import com.intellij.openapi.util.Computable; +import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.testFramework.IdeaTestCase; +import com.intellij.testFramework.IdeaTestUtil; +import org.jdom.Element; +import org.jdom.JDOMException; +import org.jetbrains.idea.eclipse.config.CachedXmlDocumentSet; +import org.jetbrains.idea.eclipse.config.EclipseClasspathStorageProvider; +import org.jetbrains.idea.eclipse.config.EclipseModuleManager; +import org.jetbrains.idea.eclipse.importWizard.EclipseProjectFinder; + +import java.io.File; +import java.io.IOException; + +public class EclipseEmlTest extends IdeaTestCase { + @Override + protected void setUp() throws Exception { + super.setUp(); + final File testRoot = new File(PluginPathManager.getPluginHomePath("eclipse") + "/testData", "eml"); + assertTrue(testRoot.getAbsolutePath(), testRoot.isDirectory()); + + final File currentTestRoot = new File(testRoot, getTestName(true)); + assertTrue(currentTestRoot.getAbsolutePath(), currentTestRoot.isDirectory()); + + FileUtil.copyDir(currentTestRoot, new File(getProject().getBaseDir().getPath())); + + + } + + + + private void doTest(String relativePath) throws Exception { + final String path = getProject().getBaseDir().getPath() + relativePath; + final Module module = ApplicationManager.getApplication().runWriteAction(new Computable() { + public Module compute() { + return ModuleManager.getInstance(getProject()) + .newModule(path + "/" + EclipseProjectFinder.findProjectName(path) + IdeaXml.IML_EXT, StdModuleTypes.JAVA); + } + }); + + replaceRoot(path, module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX); + replaceRoot(path, EclipseXml.DOT_CLASSPATH_EXT); + + + final EclipseClasspathStorageProvider.EclipseClasspathConverter converter = + new EclipseClasspathStorageProvider.EclipseClasspathConverter(module); + final ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel(); + + final Element classpathElement = JDOMUtil.loadDocument(new String(FileUtil.loadFileText(new File(path, EclipseXml.DOT_CLASSPATH_EXT)))).getRootElement(); + converter.getClasspath(rootModel, classpathElement); + + final File tempDirectory = FileUtil.createTempDirectory("", ""); + tempDirectory.deleteOnExit(); + FileUtil.copyDir(new File(path), tempDirectory); + + new EclipseClasspathStorageProvider.EclipseClasspathConverter(module) { + @Override + public CachedXmlDocumentSet getFileSet() { + CachedXmlDocumentSet fileCache = new CachedXmlDocumentSet(module.getProject()); + EclipseModuleManager.getInstance(module).setDocumentSet(fileCache); + EclipseClasspathStorageProvider + .registerFiles(fileCache, module, tempDirectory.getPath(), tempDirectory.getPath()); + fileCache.preload(); + return fileCache; + } + }.setClasspath(rootModel); + rootModel.dispose(); + + IdeaTestUtil.assertDirectoriesEqual(LocalFileSystem.getInstance().findFileByIoFile(new File(path, EclipseXml.DOT_CLASSPATH_EXT).getParentFile()), + LocalFileSystem.getInstance().findFileByIoFile(tempDirectory), null); + } + + private void replaceRoot(String path, final String child) throws IOException, JDOMException { + final File emlFile = new File(path, child); + String fileText = new String(FileUtil.loadFileText(emlFile)).replaceAll("\\$ROOT\\$", getProject().getBaseDir().getPath()); + if (!SystemInfo.isWindows) { + fileText = fileText.replaceAll(EclipseXml.FILE_PROTOCOL + "/", EclipseXml.FILE_PROTOCOL); + } + JDOMUtil.writeDocument(JDOMUtil.loadDocument(fileText), emlFile, "\n"); + } + + public void testSrcInZip() throws Exception { + doTest("/test"); + } + +} \ No newline at end of file From f56270a039b6c961f19214f61e1eff7eb3fef52f Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 18 Dec 2009 22:11:21 +0300 Subject: [PATCH 9/9] IDEA-26869 --- .../scope/packageSet/PatternPackageSetParserExtension.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/java-impl/src/com/intellij/psi/search/scope/packageSet/PatternPackageSetParserExtension.java b/java/java-impl/src/com/intellij/psi/search/scope/packageSet/PatternPackageSetParserExtension.java index 1be9dbf1b728..ad4e96779750 100644 --- a/java/java-impl/src/com/intellij/psi/search/scope/packageSet/PatternPackageSetParserExtension.java +++ b/java/java-impl/src/com/intellij/psi/search/scope/packageSet/PatternPackageSetParserExtension.java @@ -27,9 +27,9 @@ import com.intellij.psi.search.scope.packageSet.lexer.ScopeTokenTypes; public class PatternPackageSetParserExtension implements PackageSetParserExtension { public PackageSet parsePackageSet(final Lexer lexer, final String scope, final String modulePattern) throws ParsingException { - if (scope == PatternPackageSet.SCOPE_ANY && modulePattern == null) { + /*if (scope == PatternPackageSet.SCOPE_ANY && modulePattern == null) { error(AnalysisScopeBundle.message("error.packageset.common.expectations"), lexer); - } + }*/ if (scope != PatternPackageSet.SCOPE_ANY && scope != PatternPackageSet.SCOPE_LIBRARY && scope != PatternPackageSet.SCOPE_PROBLEM &&