mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git.labs.intellij.net:idea/community
This commit is contained in:
+30
-9
@@ -432,17 +432,17 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler {
|
||||
}
|
||||
|
||||
private Set<String> deleteFiles(final List<String> paths, CompileContext context) {
|
||||
|
||||
final Set<Artifact> artifactsToBuild = getAffectedArtifacts(context);
|
||||
|
||||
final boolean testMode = ApplicationManager.getApplication().isUnitTestMode();
|
||||
final THashSet<String> deletedJars = new THashSet<String>();
|
||||
final THashSet<String> notDeletedJars = new THashSet<String>();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Deleting outdated files...");
|
||||
}
|
||||
|
||||
int notDeletedFilesCount = 0;
|
||||
final Artifact[] allArtifacts = ArtifactManager.getInstance(context.getProject()).getArtifacts();
|
||||
|
||||
List<File> filesToRefresh = new ArrayList<File>();
|
||||
for (String fullPath : paths) {
|
||||
boolean isUnderOutput = false;
|
||||
@@ -460,23 +460,44 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler {
|
||||
if (isUnderOutput && !isInArtifactsToBuild) continue;
|
||||
|
||||
int end = fullPath.indexOf(JarFileSystem.JAR_SEPARATOR);
|
||||
String filePath = end != -1 ? fullPath.substring(0, end) : fullPath;
|
||||
if (end != -1) {
|
||||
deletedJars.add(filePath);
|
||||
boolean isJar = end != -1;
|
||||
String filePath = isJar ? fullPath.substring(0, end) : fullPath;
|
||||
boolean deleted = false;
|
||||
if (isJar) {
|
||||
if (notDeletedJars.contains(filePath)) {
|
||||
continue;
|
||||
}
|
||||
deleted = deletedJars.contains(filePath);
|
||||
}
|
||||
|
||||
File file = new File(FileUtil.toSystemDependentName(filePath));
|
||||
filesToRefresh.add(file);
|
||||
boolean deleted = FileUtil.delete(file);
|
||||
if (!deleted && LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cannot delete file " + file);
|
||||
if (!deleted) {
|
||||
filesToRefresh.add(file);
|
||||
deleted = FileUtil.delete(file);
|
||||
}
|
||||
|
||||
if (deleted) {
|
||||
if (isJar) {
|
||||
deletedJars.add(filePath);
|
||||
}
|
||||
if (testMode) {
|
||||
CompilerManagerImpl.addDeletedPath(file.getAbsolutePath());
|
||||
}
|
||||
getOutputItemsCache(context.getProject()).remove(fullPath);
|
||||
}
|
||||
else {
|
||||
if (isJar) {
|
||||
notDeletedJars.add(filePath);
|
||||
}
|
||||
if (notDeletedFilesCount++ > 50) {
|
||||
context.addMessage(CompilerMessageCategory.WARNING, "Deletion of outdated files stopped because too many files cannot be deleted", null, -1, -1);
|
||||
break;
|
||||
}
|
||||
context.addMessage(CompilerMessageCategory.WARNING, "Cannot delete file '" + filePath + "'", null, -1, -1);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cannot delete file " + file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CompilerUtil.refreshIOFiles(filesToRefresh);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -336,6 +336,10 @@ public class NanoXmlUtil {
|
||||
}
|
||||
|
||||
public static class ParserStoppedException extends RuntimeException {
|
||||
@Override
|
||||
public Throwable fillInStackTrace() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
private static class RootTagInfoBuilder implements IXMLBuilder {
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.editor.*;
|
||||
import com.intellij.openapi.editor.ex.EditorEx;
|
||||
import com.intellij.openapi.editor.highlighter.HighlighterIterator;
|
||||
import com.intellij.openapi.fileEditor.ex.IdeDocumentHistory;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiDocumentManager;
|
||||
@@ -50,6 +51,7 @@ public class CodeBlockUtil {
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);
|
||||
if (file == null) return;
|
||||
|
||||
IdeDocumentHistory.getInstance(project).includeCurrentCommandAsNavigation();
|
||||
final IndentGuideDescriptor guide = editor.getIndentsModel().getCaretIndentGuide();
|
||||
if (guide != null) {
|
||||
editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(guide.endLine, guide.indentLevel));
|
||||
@@ -73,6 +75,7 @@ public class CodeBlockUtil {
|
||||
int selectionStart = editor.getSelectionModel().getLeadSelectionOffset();
|
||||
if (file == null) return;
|
||||
|
||||
IdeDocumentHistory.getInstance(project).includeCurrentCommandAsNavigation();
|
||||
final IndentGuideDescriptor guide = editor.getIndentsModel().getCaretIndentGuide();
|
||||
if (guide != null) {
|
||||
editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(guide.startLine, guide.indentLevel));
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
package com.intellij.projectImport;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -39,4 +40,14 @@ public abstract class ProjectOpenProcessor {
|
||||
|
||||
@Nullable
|
||||
public abstract Project doOpenProject(@NotNull VirtualFile virtualFile, Project projectToClose, boolean forceOpenInNewFrame);
|
||||
|
||||
@Nullable
|
||||
public static ProjectOpenProcessor getImportProvider(VirtualFile file) {
|
||||
for (ProjectOpenProcessor provider : Extensions.getExtensions(EXTENSION_POINT_NAME)) {
|
||||
if (provider.canOpenProject(file)) {
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -16,7 +16,6 @@
|
||||
package com.intellij.ide.actions;
|
||||
|
||||
import com.intellij.ide.highlighter.ProjectFileType;
|
||||
import com.intellij.ide.impl.ProjectUtil;
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileElement;
|
||||
@@ -59,7 +58,7 @@ public class OpenProjectFileChooserDescriptor extends FileChooserDescriptor {
|
||||
|
||||
@Nullable
|
||||
public static Icon getImporterIcon(final VirtualFile virtualFile, final boolean open) {
|
||||
final ProjectOpenProcessor provider = ProjectUtil.getImportProvider(virtualFile);
|
||||
final ProjectOpenProcessor provider = ProjectOpenProcessor.getImportProvider(virtualFile);
|
||||
if(provider!=null) {
|
||||
return provider.getIcon();
|
||||
}
|
||||
@@ -73,7 +72,7 @@ public class OpenProjectFileChooserDescriptor extends FileChooserDescriptor {
|
||||
|
||||
private static boolean isProjectFile(final VirtualFile file) {
|
||||
return (!file.isDirectory() && file.getName().toLowerCase().endsWith(ProjectFileType.DOT_DEFAULT_EXTENSION)) ||
|
||||
(ProjectUtil.getImportProvider(file) != null);
|
||||
(ProjectOpenProcessor.getImportProvider(file) != null);
|
||||
}
|
||||
|
||||
private static boolean isProjectDirectory(final VirtualFile virtualFile) {
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.intellij.ide.highlighter.WorkspaceFileType;
|
||||
import com.intellij.openapi.components.StorageScheme;
|
||||
import com.intellij.openapi.components.impl.stores.IProjectStore;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
@@ -110,23 +109,13 @@ public class ProjectUtil {
|
||||
virtualFile.isDirectory() && virtualFile.findChild(DIRECTORY_BASED_PROJECT_DIR) != null) {
|
||||
return openProject(path, projectToClose, forceOpenInNewFrame);
|
||||
}
|
||||
ProjectOpenProcessor provider = getImportProvider(virtualFile);
|
||||
ProjectOpenProcessor provider = ProjectOpenProcessor.getImportProvider(virtualFile);
|
||||
if (provider != null) {
|
||||
return provider.doOpenProject(virtualFile, projectToClose, forceOpenInNewFrame);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ProjectOpenProcessor getImportProvider(VirtualFile file) {
|
||||
for (ProjectOpenProcessor provider : Extensions.getExtensions(ProjectOpenProcessor.EXTENSION_POINT_NAME)) {
|
||||
if (provider.canOpenProject(file)) {
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Project openProject(final String path, Project projectToClose, boolean forceOpenInNewFrame) {
|
||||
File file = new File(path);
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.intellij.openapi.vcs.VcsBundle;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.projectImport.ProjectOpenProcessor;
|
||||
import com.intellij.ui.ColoredTableCellRenderer;
|
||||
import com.intellij.ui.SimpleTextAttributes;
|
||||
import com.intellij.ui.table.TableView;
|
||||
@@ -320,7 +321,8 @@ public class MultipleFileMergeDialog extends DialogWrapper {
|
||||
private void checkMarkModifiedProject(final VirtualFile file) {
|
||||
if (file.getFileType() == StdFileTypes.IDEA_MODULE ||
|
||||
file.getFileType() == StdFileTypes.IDEA_PROJECT ||
|
||||
file.getFileType() == StdFileTypes.IDEA_WORKSPACE) {
|
||||
file.getFileType() == StdFileTypes.IDEA_WORKSPACE ||
|
||||
ProjectOpenProcessor.getImportProvider(file) != null) {
|
||||
myProjectManager.saveChangedProjectFile(file, myProject);
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -24,6 +24,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.projectImport.ProjectOpenProcessor;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -64,6 +65,7 @@ public class UpdateReceivedFileProcessor implements ReceivedFileProcessor {
|
||||
|
||||
private static boolean isProjectOrModuleFile(VirtualFile virtualFile) {
|
||||
if (virtualFile == null) return false;
|
||||
if (ProjectOpenProcessor.getImportProvider(virtualFile) != null) return true;
|
||||
FileType fileType = FileTypeManager.getInstance().getFileTypeByFile(virtualFile);
|
||||
return
|
||||
fileType == StdFileTypes.IDEA_PROJECT
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<javac source="1.5" destdir="anttask.classes" fork="true">
|
||||
<javac source="1.5" target="1.5" destdir="anttask.classes" fork="true">
|
||||
<src path="anttask.src"/>
|
||||
<classpath>
|
||||
<fileset dir="${build.lib.path}">
|
||||
|
||||
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
<id>org.intellij.groovy.hotswap</id>
|
||||
<name>Groovy HotSwap</name>
|
||||
<description>Enables HotSwap functionality in Groovy classes</description>
|
||||
<version>0.3</version>
|
||||
<version>0.4</version>
|
||||
<idea-version since-build="93.90" until-build="96.1"/>
|
||||
<vendor logo="/org/jetbrains/plugins/groovy/images/groovy_16x16.png" url="http://www.jetbrains.com">JetBrains Inc.</vendor>
|
||||
<depends>org.intellij.groovy</depends>
|
||||
|
||||
Reference in New Issue
Block a user