private static void prepare(
    @NotNull ProjectConnection connection,
    @NotNull LongRunningOperation operation,
    @NotNull ExternalSystemTaskId id,
    @NotNull List<String> tasksAndArguments,
    @NotNull GradleExecutionSettings settings,
    @NotNull ExternalSystemTaskNotificationListener listener
  ) {
    clearSystemProperties(operation);

    applyIdeaParameters(settings);

    BuildEnvironment buildEnvironment = getBuildEnvironment(connection, id, listener, null, settings);

    setupJvmArguments(operation, settings, buildEnvironment);

    setupLogging(settings, buildEnvironment);

    setupArguments(operation, tasksAndArguments, settings);

    setupEnvironment(operation, settings);

    setupJavaHome(operation, settings);

    setupProgressListeners(operation, settings, id, listener, buildEnvironment);

    setupStandardIO(operation, settings, id, listener);

    GradleOperationHelperExtension.EP_NAME
      .forEachExtensionSafe(proc -> proc.prepareForExecution(id, operation, settings, buildEnvironment));
  }
private static void prepare(
    @NotNull ProjectConnection connection,
    @NotNull LongRunningOperation operation,
    @NotNull ExternalSystemTaskId id,
    @NotNull List<String> tasksAndArguments,
    @NotNull GradleExecutionSettings settings,
    @NotNull ExternalSystemTaskNotificationListener listener
  )