private static void runModulesResourcesBuildTasks(@NotNull Project project,
                                                    @NotNull ProjectTaskContext context,
                                                    @NotNull MyNotificationCollector notificationCollector,
                                                    @NotNull Map<Class<? extends ProjectTask>, List<ProjectTask>> tasksMap) {
    Collection<? extends ProjectTask> buildTasks = tasksMap.get(ModuleResourcesBuildTask.class);
    if (ContainerUtil.isEmpty(buildTasks)) return;

    CompilerManager compilerManager = CompilerManager.getInstance(project);

    ModulesBuildSettings buildSettings = assembleModulesBuildSettings(buildTasks);
    CompileScope scope = createScope(
      compilerManager, context, buildSettings.modules, buildSettings.includeDependentModules, buildSettings.includeRuntimeDependencies, buildSettings.includeTests
    );
    List<String> moduleNames = ContainerUtil.map(buildSettings.modules, Module::getName);
    CompileScopeUtil.setResourcesScopeForExternalBuild(scope, moduleNames);

    if (buildSettings.isIncrementalBuild) {
      compilerManager.make(scope, new MyCompileStatusNotification(notificationCollector));
    }
    else {
      compilerManager.compile(scope, new MyCompileStatusNotification(notificationCollector));
    }
  }
private static void runModulesResourcesBuildTasks(@NotNull Project project,
                                                    @NotNull ProjectTaskContext context,
                                                    @NotNull MyNotificationCollector notificationCollector,
                                                    @NotNull Map<Class<? extends ProjectTask>, List<ProjectTask>> tasksMap)