void (@NotNull ProjectResolverContext context, @NotNull DataNode<ProjectData> projectDataNode, @NotNull File gradleUserHomeDir, @Nullable File gradleHomeDir, @Nullable GradleVersion gradleVersion) { final Map<String, Pair<DataNode<GradleSourceSetData>, ExternalSourceSet>> sourceSetMap = projectDataNode.getUserData(RESOLVED_SOURCE_SETS); assert sourceSetMap != null; final Map<String, Pair<String, ExternalSystemSourceType>> moduleOutputsMap = projectDataNode.getUserData(MODULES_OUTPUTS); assert moduleOutputsMap != null; final ArtifactMappingService artifactsMap = context.getArtifactsMap(); assert artifactsMap != null; final Collection<DataNode<LibraryDependencyData>> libraryDependencies = findAllRecursively(projectDataNode, ProjectKeys.LIBRARY_DEPENDENCY); LibraryDataNodeSubstitutor librarySubstitutor = new LibraryDataNodeSubstitutor( context, gradleUserHomeDir, gradleHomeDir, gradleVersion, sourceSetMap, moduleOutputsMap, artifactsMap); for (DataNode<LibraryDependencyData> libraryDependencyDataNode : libraryDependencies) { librarySubstitutor.run(libraryDependencyDataNode); } }