void (CompileContext context) { if (JavaBackwardReferenceIndexWriter.getInstance() != null) { final BuildTargetIndex targetIndex = context.getProjectDescriptor().getBuildTargetIndex(); for (JpsModule module : context.getProjectDescriptor().getProject().getModules()) { boolean allAreDummyOrCompiled = true; for (ModuleBasedTarget<?> target : targetIndex.getModuleBasedTargets(module, BuildTargetRegistry.ModuleTargetSelector.ALL)) { if (target instanceof ModuleBuildTarget && !myCompiledTargets.contains(target) && !targetIndex.isDummy(target)) { allAreDummyOrCompiled = false; } } if (allAreDummyOrCompiled) { context.processMessage(new CustomBuilderMessage(BUILDER_ID, MESSAGE_TYPE, module.getName())); } } myCompiledTargets.clear(); } JavaBackwardReferenceIndexWriter.closeIfNeeded(false); }