GWT: don't start (slow and non-incremental) GWT compilation for whole module if ...
[idea/community.git] / jps / jps-builders / src / org / jetbrains / jps / incremental / CompileScopeImpl.java
index afb1f271a59726dca1c97d48ad5bfcc6a0c341cc..d3a6ca5d443bdb6e530fdd538347d232364a9b40 100644 (file)
@@ -62,13 +62,17 @@ public class CompileScopeImpl extends CompileScope {
 
   @Override
   public boolean isAffected(@NotNull BuildTarget<?> target) {
-    return myTypes.contains(target.getTargetType()) || myTargets.contains(target) || myFiles.containsKey(target) || isAffectedByAssociatedModule(target);
+    return isWholeTargetAffected(target) || myFiles.containsKey(target);
+  }
+
+  @Override
+  public boolean isWholeTargetAffected(@NotNull BuildTarget<?> target) {
+    return myTypes.contains(target.getTargetType()) || myTargets.contains(target) || isAffectedByAssociatedModule(target);
   }
 
   @Override
   public boolean isBuildForced(@NotNull BuildTarget<?> target) {
-    BuildTargetType<?> type = target.getTargetType();
-    return myTypesToForceBuild.contains(type) && myFiles.isEmpty() && (myTypes.contains(type) || myTargets.contains(target) || isAffectedByAssociatedModule(target));
+    return myTypesToForceBuild.contains(target.getTargetType()) && myFiles.isEmpty() && isWholeTargetAffected(target);
   }
 
   @Override