void (@NotNull Project project, @NotNull ProjectTaskContext context, @NotNull MyNotificationCollector notificationCollector, @NotNull Map<Class<? extends ProjectTask>, List<ProjectTask>> tasksMap) { Collection<? extends ProjectTask> buildTasks = tasksMap.get(ProjectModelBuildTask.class); if (!ContainerUtil.isEmpty(buildTasks)) { List<Artifact> toMake = new SmartList<>(); List<Artifact> toCompile = new SmartList<>(); for (ProjectTask buildProjectTask : buildTasks) { ProjectModelBuildTask buildTask = (ProjectModelBuildTask)buildProjectTask; ProjectModelBuildableElement buildableElement = buildTask.getBuildableElement(); if (buildableElement instanceof Artifact) { if (buildTask.isIncrementalBuild()) { toMake.add((Artifact)buildableElement); } else { toCompile.add((Artifact)buildableElement); } } } buildArtifacts(project, toMake, context.getSessionId(), notificationCollector, false); buildArtifacts(project, toCompile, context.getSessionId(), notificationCollector, true); } }