private static boolean runTaskAsExistingConfiguration(@NotNull Project project,
                                                        @NotNull ProjectSystemId projectSystemId,
                                                        @NotNull ExternalTaskExecutionInfo taskExecutionInfo,
                                                        @NotNull RunnerAndConfigurationSettings configuration) {
    final String executorId = taskExecutionInfo.getExecutorId();
    String runnerId = ExternalSystemUtil.getRunnerId(executorId);
    if (runnerId == null) {
      return false;
    }
    Executor executor = ExecutorRegistry.getInstance().getExecutorById(executorId);
    ProgramRunner<?> runner = ProgramRunner.findRunnerById(runnerId);

    if (executor == null || runner == null) {
      return false;
    }

    ExecutionEnvironment environment = new ExecutionEnvironment(executor, runner, configuration, project);
    ApplicationManager.getApplication().invokeLater(() -> {
      try {
        environment.getRunner().execute(environment);
      }
      catch (ExecutionException exception) {
        LOG.error("Failed to execute " + projectSystemId.getReadableName() + " task.", exception);
      }
    });

    return true;
  }
private static boolean runTaskAsExistingConfiguration(@NotNull Project project,
                                                        @NotNull ProjectSystemId projectSystemId,
                                                        @NotNull ExternalTaskExecutionInfo taskExecutionInfo,
                                                        @NotNull RunnerAndConfigurationSettings configuration)