Source:
public void build(@NotNull ErlangModuleBuildOrderTarget target, @NotNull DirtyFilesHolder<ErlangSourceRootDescriptor, ErlangModuleBuildOrderTarget> holder, @NotNull BuildOutputConsumer outputConsumer, @NotNull CompileContext context) throws ProjectBuildException, IOException { LOG.info("Computing dirty files"); LOG.debug("Load project build order."); ErlangProjectBuildOrder projectBuildOrder = loadProjectBuildOrder(context); if (projectBuildOrder == null) { addPrepareDependenciesFailedMessage(context); return; } LOG.debug("Collect dirty files."); List<String> dirtyErlangFilePaths = new DirtyFileProcessor<String, ErlangModuleBuildOrderTarget>() { @Nullable @Override protected String getDirtyElement(@NotNull File file) throws IOException { return isSourceOrHeader(file) ? file.getAbsolutePath() : null; } }.collectDirtyElements(holder); List<ErlangTarget> erlangTargets = ContainerUtil.mapNotNull(context.getProjectDescriptor().getBuildTargetIndex().getAllTargets(), new Function<BuildTarget<?>, ErlangTarget>() { @Nullable @Override public ErlangTarget fun(BuildTarget<?> buildTarget) { return buildTarget instanceof ErlangTarget ? (ErlangTarget) buildTarget : null; } }); for (ErlangTarget erlangTarget : erlangTargets) { erlangTarget.setBuildOrder(new ErlangModuleBuildOrder()); } if (dirtyErlangFilePaths.isEmpty()) { LOG.debug("There aren't dirty .erl or .hrl files."); } else { LOG.debug("Search dirty modules."); List<String> sortedDirtyModules = getSortedDirtyModules(context, projectBuildOrder, dirtyErlangFilePaths); addFilesToBuiltTarget(context, sortedDirtyModules); } }

Target:
public void build(@NotNull ErlangModuleBuildOrderTarget target, @NotNull DirtyFilesHolder<ErlangSourceRootDescriptor, ErlangModuleBuildOrderTarget> holder, @NotNull BuildOutputConsumer outputConsumer, @NotNull CompileContext context) throws ProjectBuildException, IOException { LOG.info("Computing dirty files"); LOG.debug("Load project build order."); ErlangProjectBuildOrder projectBuildOrder = loadProjectBuildOrder(context); if (projectBuildOrder == null) { addPrepareDependenciesFailedMessage(context); return; } List<ErlangTarget> erlangTargets = ContainerUtil.mapNotNull(context.getProjectDescriptor().getBuildTargetIndex().getAllTargets(), new Function<BuildTarget<?>, ErlangTarget>() { @Nullable @Override public ErlangTarget fun(BuildTarget<?> buildTarget) { return buildTarget instanceof ErlangTarget ? (ErlangTarget) buildTarget : null; } }); for (ErlangTarget erlangTarget : erlangTargets) { erlangTarget.setBuildOrder(new ErlangModuleBuildOrder()); } LOG.debug("Collect dirty files."); List<String> dirtyErlangFilePaths = new DirtyFileProcessor<String, ErlangModuleBuildOrderTarget>() { @Nullable @Override protected String getDirtyElement(@NotNull File file) throws IOException { String fileName = file.getName(); return isSource(fileName) || isHeader(fileName) ? file.getAbsolutePath() : null; } }.collectDirtyElements(holder); if (dirtyErlangFilePaths.isEmpty()) { LOG.debug("There aren't dirty .erl or .hrl files."); } else { LOG.debug("Search dirty modules."); List<String> sortedDirtyModules = getSortedDirtyModules(projectBuildOrder, dirtyErlangFilePaths); addFilesToBuiltTarget(context, sortedDirtyModules); } }