mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
build process: ignore information about changes from IDE if there are unloaded modules
Otherwise it may incorrectly skip build because unloaded modules aren't monitored by IDE (IDEA-180530).
This commit is contained in:
@@ -71,6 +71,23 @@ public class UnloadedModulesCompilationTest extends BaseCompilerTestCase {
|
||||
make(createScopeWithUnloaded(Collections.singletonList(util), unloadedList), CompilerFilter.ALL).assertGenerated("A.class", "Util.class");
|
||||
}
|
||||
|
||||
public void testCompileUnloadedModuleAfterBuildingAllLoadedModules() {
|
||||
VirtualFile utilFile = createFile("util/src/Util.java", "class Util { }");
|
||||
Module util = addModule("util", utilFile.getParent());
|
||||
VirtualFile a = createFile("unloaded/src/A.java", "class A { Util u = new Util(); }");
|
||||
Module unloaded = addModule("unloaded", a.getParent());
|
||||
ModuleRootModificationUtil.addDependency(unloaded, util);
|
||||
buildAllModules();
|
||||
|
||||
List<String> unloadedList = Collections.singletonList(unloaded.getName());
|
||||
ModuleManager.getInstance(myProject).setUnloadedModules(unloadedList);
|
||||
|
||||
changeFile(utilFile, "class Util { Util(int i) {} }");
|
||||
buildAllModules().assertGenerated("Util.class");
|
||||
|
||||
compile(createScopeWithUnloaded(Collections.singletonList(util), unloadedList), CompilerFilter.ALL, false, true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ModuleCompileScope createScopeWithUnloaded(List<Module> modules, List<String> unloaded) {
|
||||
return new ModuleCompileScope(myProject, modules, unloaded, true, false);
|
||||
|
||||
@@ -97,8 +97,8 @@ final class BuildSession implements Runnable, CanceledStatus {
|
||||
for (CmdlineRemoteProto.Message.KeyValuePair pair : params.getBuilderParameterList()) {
|
||||
builderParams.put(pair.getKey(), pair.getValue());
|
||||
}
|
||||
myInitialFSDelta = delta;
|
||||
boolean loadUnloadedModules = Boolean.parseBoolean(builderParams.get(BuildParametersKeys.LOAD_UNLOADED_MODULES));
|
||||
myInitialFSDelta = loadUnloadedModules ? null : delta;
|
||||
if (loadUnloadedModules && preloaded != null) {
|
||||
myPreloadedData = null;
|
||||
ProjectDescriptor projectDescriptor = preloaded.getProjectDescriptor();
|
||||
|
||||
Reference in New Issue
Block a user