docs: public static Map<DependencyDescriptor, Set<DependencyDescriptor>>
      determineProjectDependencies(Project project, String configuration, boolean resolveChildrenTransitively) {
          if (project == null) {
              throw new IllegalArgumentException("Gradle project reference cannot be null.");
          }
          project.getLogger().info("Requesting dependencies for configuration: {}", configuration);
          Configuration requestedConfiguration = project.getConfigurations().findByName(configuration);
          if (requestedConfiguration == null) {
              project.getLogger().warn("Unable to locate dependency configuration with name: {}", configuration);
              return Collections.emptyMap();
          }
  
          //
          // Step 1
          // ------
          // Iterate through the hierarchy of the given configuration and determine the correct scope of all
          // "top-level" dependencies.
          //
          Map<String, String> dependencyScopeMap = new HashMap<>();
  
          // In case of custom configurations, we will assign the scope to what has been requested
          String defaultScopeForUnknownConfigurations =
                  REMAPPED_SCOPES.computeIfAbsent(requestedConfiguration.getName(), cfgName -> {
                      throw new IllegalStateException("Unknown configuration name provided: " + cfgName);
                  });
          requestedConfiguration.getHierarchy().forEach(cfg -> {
              cfg.getDependencies().forEach(dep -> {
                  String key = String.format("%s:%s", dep.getGroup(), dep.getName());
                  dependencyScopeMap.put(key, REMAPPED_SCOPES.getOrDefault(cfg.getName(), defaultScopeForUnknownConfigurations));
              });
          });
  
          //
          // Step 2
          // ------
          // Assuming that the given configuration can be resolved, get the resolved artifacts and populate the return Map.
          //
          ResolvedConfiguration resolvedConfig = requestedConfiguration.getResolvedConfiguration();
          Map<DependencyDescriptor, Set<DependencyDescriptor>> dependencyMap = new HashMap<>();
          resolvedConfig.getFirstLevelModuleDependencies().forEach(resolvedDep -> {
              String lookup = String.format("%s:%s", resolvedDep.getModuleGroup(), resolvedDep.getModuleName());
              String scope = dependencyScopeMap.get(lookup);
              if (scope == null) {
                  // Should never happen.
                  throw new IllegalStateException("Gradle dependency resolution logic is broken. Unable to get scope for dependency: " + lookup);
              }
              DependencyDescriptor key = asDescriptor(scope, resolvedDep);
              Set<DependencyDescriptor> value;
              if (resolveChildrenTransitively) {
                  value = getDependenciesTransitively(scope, resolvedDep);
              } else {
                  value = resolvedDep.getChildren()
                          .stream()
                          .map(rd -> asDescriptor(scope, rd))
                          .collect(Collectors.toSet());
              }
              dependencyMap.put(key, value);
          });
  
          printDependencyMap(dependencyMap, project);
          return dependencyMap;
      }