the right fix for groovy test

This commit is contained in:
Eugene Zhuravlev
2012-05-03 12:26:16 +02:00
parent 055320ab89
commit 4c13b97827
@@ -1309,19 +1309,33 @@ public class CompileDriver {
}
dumbService.waitForSmartMode();
if (snapshot == null || ContainerUtil.intersects(generatedTypes, compilerManager.getRegisteredInputTypes(compiler))) {
// rescan snapshot if previously generated files may influence the input of this compiler
final Set<VirtualFile> prevSnapshot = round > 0 && snapshot != null? new HashSet<VirtualFile>(Arrays.asList(snapshot)) : Collections.<VirtualFile>emptySet();
snapshot = ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile[]>() {
public VirtualFile[] compute() {
return context.getCompileScope().getFiles(null, true);
}
});
recalculateChunkToFilesMap(context, sortedChunks, snapshot, chunkMap);
chunkFiles = chunkMap.get(currentChunk);
if (round == 0) {
chunkFiles = chunkMap.get(currentChunk);
}
else {
final Set<VirtualFile> newFiles = new HashSet<VirtualFile>(chunkMap.get(currentChunk));
newFiles.removeAll(prevSnapshot);
newFiles.removeAll(chunkFiles);
if (!newFiles.isEmpty()) {
final ArrayList<VirtualFile> merged = new ArrayList<VirtualFile>(chunkFiles.size() + newFiles.size());
merged.addAll(chunkFiles);
merged.addAll(newFiles);
chunkFiles = merged;
}
}
total = snapshot.length * translatorsLength;
}
final CompileContextEx _context;
if (compiler instanceof IntermediateOutputCompiler) {
// wrap compile context so that output goes into intermediate directories