BuildResult (final ProjectDescriptor descriptor, CompileScopeTestBuilder scopeBuilder) { IncProjectBuilder builder = new IncProjectBuilder(descriptor, BuilderRegistry.getInstance(), myBuildParams, CanceledStatus.NULL, true); BuildResult result = new BuildResult(); builder.addMessageHandler(result); try { beforeBuildStarted(descriptor); builder.build(scopeBuilder.build(), false); result.storeMappingsDump(descriptor); } catch (RebuildRequestedException | IOException e) { throw new RuntimeException(e); } finally { // the following code models module index reload after each make session JavaModuleIndex moduleIndex = JpsJavaExtensionService.getInstance().getJavaModuleIndex(descriptor.getProject()); if (moduleIndex instanceof JavaModuleIndexImpl) { ((JavaModuleIndexImpl)moduleIndex).dropCache(); } } return result; }