@Override
  public void executeTasks(final @NotNull ExternalSystemTaskId id,
                           final @NotNull List<String> taskNames,
                           @NotNull String projectPath,
                           @Nullable GradleExecutionSettings settings,
                           final @Nullable String jvmParametersSetup,
                           final @NotNull ExternalSystemTaskNotificationListener listener) throws ExternalSystemException {
    final List<String> tasks = taskNames.stream()
      .flatMap(s -> ParametersListUtil.parse(s, false, true).stream())
      .collect(Collectors.toList());

    if (ExternalSystemApiUtil.isInProcessMode(GradleConstants.SYSTEM_ID)) {
      for (GradleTaskManagerExtension gradleTaskManagerExtension : GradleTaskManagerExtension.EP_NAME.getExtensions()) {
        if (gradleTaskManagerExtension.executeTasks(id, tasks, projectPath, settings, jvmParametersSetup, listener)) {
          return;
        }
      }
    }

    GradleExecutionSettings effectiveSettings =
      settings == null ? new GradleExecutionSettings(null, null, DistributionType.BUNDLED, false) : settings;

    CancellationTokenSource cancellationTokenSource = GradleConnector.newCancellationTokenSource();
    CancellationToken cancellationToken = cancellationTokenSource.token();
    myCancellationMap.put(id, cancellationTokenSource);
    try {
      if (effectiveSettings.getDistributionType() == DistributionType.WRAPPED) {
        String rootProjectPath = determineRootProject(projectPath);
        GradleWrapperHelper.ensureInstalledWrapper(id, rootProjectPath, effectiveSettings, listener, cancellationToken);
      }
      myHelper.execute(projectPath, effectiveSettings, id, listener, cancellationToken, connection -> {
        executeTasks(id, tasks, projectPath, effectiveSettings, jvmParametersSetup, listener, connection, cancellationToken);
        return null;
      });
    }
    finally {
      myCancellationMap.remove(id);
    }
  }
@Override
  public void executeTasks(final @NotNull ExternalSystemTaskId id,
                           final @NotNull List<String> taskNames,
                           @NotNull String projectPath,
                           @Nullable GradleExecutionSettings settings,
                           final @Nullable String jvmParametersSetup,
                           final @NotNull ExternalSystemTaskNotificationListener listener)