public static @NotNull @NlsActions.ActionText String generateName(@NotNull Project project,
                                                                    @NotNull ProjectSystemId externalSystemId,
                                                                    @Nullable String externalProjectPath,
                                                                    @NotNull List<String> taskNames,
                                                                    @Nullable @Nls String executionName,
                                                                    @NotNull String tasksPrefix,
                                                                    @NotNull String tasksPostfix) {
    if (!StringUtil.isEmpty(executionName)) {
      return executionName;
    }
    boolean isTasksAbsent = taskNames.isEmpty();
    String rootProjectPath = null;
    if (externalProjectPath != null) {
      final ExternalProjectInfo projectInfo = ExternalSystemUtil.getExternalProjectInfo(project, externalSystemId, externalProjectPath);
      if (projectInfo != null) {
        rootProjectPath = projectInfo.getExternalProjectPath();
      }
    }

    @Nls StringBuilder buffer = new StringBuilder();
    final String projectName;
    if (rootProjectPath == null) {
      projectName = null;
    }
    else {
      final ExternalSystemUiAware uiAware = ExternalSystemUiUtil.getUiAware(externalSystemId);
      projectName = uiAware.getProjectRepresentationName(project, externalProjectPath, rootProjectPath);
    }
    if (!StringUtil.isEmptyOrSpaces(projectName)) {
      buffer.append(projectName);
    }
    else if (!StringUtil.isEmptyOrSpaces(externalProjectPath)) {
      buffer.append(externalProjectPath);
    }

    if (!isTasksAbsent) buffer.append(tasksPrefix);
    if (!StringUtil.isEmpty(executionName)) {
      buffer.append(executionName);
    }
    else {
      if (!isTasksAbsent) {
        for (String taskName : taskNames) {
          buffer.append(taskName).append(' ');
        }
        buffer.setLength(buffer.length() - 1);
      }
    }
    if (!isTasksAbsent) buffer.append(tasksPostfix);

    if (buffer.length() == 0) {
      buffer.append(ExecutionBundle.message("run.configuration.unnamed.name.prefix"));
    }
    return buffer.toString();
  }
public static @NotNull @NlsActions.ActionText String generateName(@NotNull Project project,
                                                                    @NotNull ProjectSystemId externalSystemId,
                                                                    @Nullable String externalProjectPath,
                                                                    @NotNull List<String> taskNames,
                                                                    @Nullable @Nls String executionName,
                                                                    @NotNull String tasksPrefix,
                                                                    @NotNull String tasksPostfix)