@Override
  @VisibleForTesting
  public boolean setupConfigurationFromContext(@NotNull GradleRunConfiguration configuration,
                                                  @NotNull ConfigurationContext context,
                                                  @NotNull Ref<PsiElement> sourceElement) {
    final Location contextLocation = context.getLocation();
    if (!isFromGroovyGradleScript(contextLocation)) return false;

    final Module module = context.getModule();
    if (module == null) return false;

    String projectPath = resolveProjectPath(module);
    if (projectPath == null) {
      VirtualFile virtualFile = contextLocation.getVirtualFile();
      projectPath = virtualFile != null ? virtualFile.getPath() : null;
    }
    if (projectPath == null) {
      return false;
    }

    List<String> tasksToRun = getTasksTarget(contextLocation);
    ExternalSystemTaskExecutionSettings taskExecutionSettings = configuration.getSettings();
    taskExecutionSettings.setExternalProjectPath(projectPath);
    taskExecutionSettings.setTaskNames(tasksToRun);
    configuration.setName(AbstractExternalSystemTaskConfigurationType.generateName(module.getProject(), taskExecutionSettings));
    return true;
  }
@Override
  @VisibleForTesting
  public boolean setupConfigurationFromContext(@NotNull GradleRunConfiguration configuration,
                                                  @NotNull ConfigurationContext context,
                                                  @NotNull Ref<PsiElement> sourceElement)