GWT: don't start (slow and non-incremental) GWT compilation for whole module if ...
[idea/community.git] / jps / jps-builders / testSrc / org / jetbrains / jps / builders / CompileScopeTestBuilder.java
index 73f1e3ebe1e09876c35de512992603036cd519f1..d633583e91600fcd4e0216cafaa174a00949ff96 100644 (file)
@@ -35,6 +35,7 @@ public class CompileScopeTestBuilder {
   private final boolean myForceBuild;
   private final Set<BuildTargetType<?>> myTargetTypes = new HashSet<BuildTargetType<?>>();
   private final Set<BuildTarget<?>> myTargets = new HashSet<BuildTarget<?>>();
+  private LinkedHashMap<BuildTarget<?>, Set<File>> myFiles = new LinkedHashMap<BuildTarget<?>, Set<File>>();
 
   public static CompileScopeTestBuilder rebuild() {
     return new CompileScopeTestBuilder(true);
@@ -78,9 +79,19 @@ public class CompileScopeTestBuilder {
     return this;
   }
 
+  public CompileScopeTestBuilder file(BuildTarget<?> target, String path) {
+    Set<File> files = myFiles.get(target);
+    if (files == null) {
+      files = new LinkedHashSet<File>();
+      myFiles.put(target, files);
+    }
+    files.add(new File(path));
+    return this;
+  }
+
   public CompileScope build() {
     Collection<BuildTargetType<?>> typesToForceBuild = myForceBuild ? myTargetTypes : Collections.<BuildTargetType<?>>emptyList();
-    return new CompileScopeImpl(myTargetTypes, typesToForceBuild, myTargets, Collections.<BuildTarget<?>,Set<File>>emptyMap());
+    return new CompileScopeImpl(myTargetTypes, typesToForceBuild, myTargets, myFiles);
   }
 
   public CompileScopeTestBuilder all() {