mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
append generated sources dirs to ModuleCompileScope when "compile module" action was invoked
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user