From 72da86984e540030cca74d12944761fb7cd03ceb Mon Sep 17 00:00:00 2001 From: nik Date: Wed, 14 Oct 2009 15:49:35 +0400 Subject: [PATCH] =?utf8?q?IDEADEV-40819:=20Artifact:=20jar=20artifact=20in?= =?utf8?q?cludes=20ignored=20directories=20(=E2=80=8Bfrom=20web=20facet=20?= =?utf8?q?resources)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../impl/compiler/IncrementalArtifactsCompiler.java | 14 +++++--------- .../IncrementalCompilerInstructionCreatorBase.java | 10 ++++++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/IncrementalArtifactsCompiler.java b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/IncrementalArtifactsCompiler.java index 9b3cf3129f..978a951cc8 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/IncrementalArtifactsCompiler.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/IncrementalArtifactsCompiler.java @@ -66,7 +66,7 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler { private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.packagingCompiler.PackagingCompilerBase"); @Nullable private PackagingCompilerCache myOutputItemsCache; - protected ArtifactPackagingProcessingItem[] collectItems(ArtifactsProcessingItemsBuilderContext builderContext, final Project project) { + protected static ArtifactPackagingProcessingItem[] collectItems(ArtifactsProcessingItemsBuilderContext builderContext, final Project project) { final CompileContext context = builderContext.getCompileContext(); final Set artifactsToBuild = ArtifactCompileScope.getArtifactsToBuild(project, context.getCompileScope()); @@ -84,7 +84,7 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler { return builderContext.getProcessingItems(); } - protected void onBuildFinished(ArtifactsProcessingItemsBuilderContext context, JarsBuilder builder, final Project project) + protected static void onBuildFinished(ArtifactsProcessingItemsBuilderContext context) throws Exception { final CompileContext compileContext = context.getCompileContext(); final Set artifacts = getAffectedArtifacts(compileContext); @@ -112,10 +112,6 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler { rootElement.computeIncrementalCompilerInstructions(instructionCreator, resolvingContext, builderContext, artifact.getArtifactType()); } - protected String getOutputCacheId() { - return "incremental_artifacts"; - } - @NotNull public String getDescription() { return "Artifacts Packaging Compiler"; @@ -125,7 +121,7 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler { private PackagingCompilerCache getOutputItemsCache(final Project project) { if (myOutputItemsCache == null) { myOutputItemsCache = new PackagingCompilerCache( - CompilerPaths.getCompilerSystemDirectory(project).getPath() + File.separator + getOutputCacheId() + "_timestamp.dat"); + CompilerPaths.getCompilerSystemDirectory(project).getPath() + File.separator + "incremental_artifacts_timestamp.dat"); } return myOutputItemsCache; } @@ -228,7 +224,7 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler { } } - private boolean doBuild(final CompileContext context, + private static boolean doBuild(final CompileContext context, final ProcessingItem[] items, final List processedItems, final Set writtenPaths, @@ -321,7 +317,7 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler { } } - onBuildFinished(builderContext, builder, context.getProject()); + onBuildFinished(builderContext); } catch (ProcessCanceledException e) { throw e; diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/IncrementalCompilerInstructionCreatorBase.java b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/IncrementalCompilerInstructionCreatorBase.java index f4f4b7f1cb..ffa182569c 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/compiler/IncrementalCompilerInstructionCreatorBase.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/compiler/IncrementalCompilerInstructionCreatorBase.java @@ -16,8 +16,11 @@ package com.intellij.packaging.impl.compiler; import com.intellij.openapi.compiler.make.PackagingFileFilter; -import com.intellij.packaging.elements.IncrementalCompilerInstructionCreator; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.roots.ProjectFileIndex; +import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.packaging.elements.IncrementalCompilerInstructionCreator; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -36,10 +39,13 @@ public abstract class IncrementalCompilerInstructionCreatorBase implements Incre } public void addDirectoryCopyInstructions(@NotNull VirtualFile directory, @Nullable PackagingFileFilter filter) { + final Project project = myContext.getCompileContext().getProject(); + final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex(); final VirtualFile[] children = directory.getChildren(); if (children != null) { for (VirtualFile child : children) { - if (filter == null || filter.accept(child, myContext.getCompileContext())) { + if (!fileIndex.isIgnored(child) + && (filter == null || filter.accept(child, myContext.getCompileContext()))) { if (!child.isDirectory()) { addFileCopyInstruction(child, child.getName()); } -- 2.11.4.GIT