append generated sources dirs to ModuleCompileScope when "compile module" action was invoked

This commit is contained in:
Eugene Zhuravlev
2011-03-03 17:33:56 +01:00
parent 42967223de
commit 781b60e4ab
2 changed files with 19 additions and 4 deletions
@@ -238,6 +238,9 @@ public class CompileDriver {
public void compile(CompileScope scope, CompileStatusNotification callback, boolean clearingOutputDirsPossible) {
myShouldClearOutputDirectory &= clearingOutputDirsPossible;
if (containsFileIndexScopes(scope)) {
scope = addAdditionalRoots(scope, ALL_EXCEPT_SOURCE_PROCESSING);
}
if (validateCompilerConfiguration(scope, false)) {
startup(scope, false, true, callback, null, true);
}
@@ -246,6 +249,17 @@ public class CompileDriver {
}
}
private static boolean containsFileIndexScopes(CompileScope scope) {
if (scope instanceof CompositeScope) {
for (CompileScope childScope : ((CompositeScope)scope).getScopes()) {
if (containsFileIndexScopes(childScope)) {
return true;
}
}
}
return scope instanceof FileIndexCompileScope;
}
private static class CompileStatus {
final int CACHE_FORMAT_VERSION;
final boolean COMPILATION_IN_PROGRESS;
@@ -32,10 +32,7 @@ import com.intellij.util.containers.ContainerUtil;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
public class CompositeScope extends UserDataHolderBase implements CompileScope{
private final List<CompileScope> myScopes = new ArrayList<CompileScope>();
@@ -102,4 +99,8 @@ public class CompositeScope extends UserDataHolderBase implements CompileScope{
}
return super.getUserData(key);
}
public Collection<CompileScope> getScopes() {
return Collections.unmodifiableList(myScopes);
}
}