From 947bdc2ae9c6faa5ba7b83e3ffc23c2bea6752ed Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Thu, 1 Mar 2012 18:18:55 +0400 Subject: [PATCH] when adding form or bound class to recompilation, check the file for exclusion --- .../jps/incremental/java/JavaBuilder.java | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java index 3d8627bbd9b4..b2dde693b495 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java @@ -16,10 +16,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.ether.dependencyView.Callbacks; import org.jetbrains.ether.dependencyView.Mappings; -import org.jetbrains.jps.Module; -import org.jetbrains.jps.ModuleChunk; -import org.jetbrains.jps.Project; -import org.jetbrains.jps.ProjectPaths; +import org.jetbrains.jps.*; import org.jetbrains.jps.api.GlobalOptions; import org.jetbrains.jps.api.RequestFuture; import org.jetbrains.jps.incremental.*; @@ -146,17 +143,26 @@ public class JavaBuilder extends ModuleLevelBuilder { }); // force compilation of bound source file if the form is dirty + final CompilerExcludes excludes = context.getProject().getCompilerConfiguration().getExcludes(); if (!context.isProjectRebuild()) { - for (File form : formsToCompile) { + for (Iterator formsIterator = formsToCompile.iterator(); formsIterator.hasNext(); ) { + final File form = formsIterator.next(); final RootDescriptor descriptor = context.getModuleAndRoot(form); - if (descriptor != null) { - for (RootDescriptor rd : context.getModuleRoots(descriptor.module)) { - final File boundSource = getBoundSource(rd.root, form); - if (boundSource != null) { - filesToCompile.add(boundSource); - break; - } + if (descriptor == null) { + continue; + } + for (RootDescriptor rd : context.getModuleRoots(descriptor.module)) { + final File boundSource = getBoundSource(rd.root, form); + if (boundSource == null) { + continue; } + if (!excludes.isExcluded(boundSource)) { + filesToCompile.add(boundSource); + } + else { + formsIterator.remove(); + } + break; } } @@ -165,8 +171,11 @@ public class JavaBuilder extends ModuleLevelBuilder { for (File srcFile : filesToCompile) { final String srcPath = srcFile.getPath(); final String formPath = sourceToFormMap.getState(srcPath); - if (formPath != null) { - final File formFile = new File(formPath); + if (formPath == null) { + continue; + } + final File formFile = new File(formPath); + if (!excludes.isExcluded(formFile)) { if (formFile.exists()) { context.markDirty(formFile); formsToCompile.add(formFile);