Merge branch '2.6.x' into 2.7.x

Closes gh-31213
pull/31258/head
Andy Wilkinson 3 years ago
commit d1420b6abb

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2021 the original author or authors. * Copyright 2012-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,6 +24,7 @@ import java.util.stream.Collectors;
import org.gradle.api.Project; import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.LenientConfiguration;
import org.gradle.api.artifacts.ModuleVersionIdentifier; import org.gradle.api.artifacts.ModuleVersionIdentifier;
import org.gradle.api.artifacts.ResolvedArtifact; import org.gradle.api.artifacts.ResolvedArtifact;
import org.gradle.api.artifacts.ResolvedConfiguration; import org.gradle.api.artifacts.ResolvedConfiguration;
@ -75,7 +76,11 @@ class ResolvedDependencies {
ResolvedConfigurationDependencies(Set<String> projectDependencyIds, ResolvedConfigurationDependencies(Set<String> projectDependencyIds,
ResolvedConfiguration resolvedConfiguration) { ResolvedConfiguration resolvedConfiguration) {
if (!resolvedConfiguration.hasError()) { if (!resolvedConfiguration.hasError()) {
for (ResolvedArtifact resolvedArtifact : resolvedConfiguration.getResolvedArtifacts()) { LenientConfiguration lenientConfiguration = resolvedConfiguration.getLenientConfiguration();
// Ensure that all files are resolved, allowing Gradle to resolve in
// parallel if they are not
lenientConfiguration.getFiles();
for (ResolvedArtifact resolvedArtifact : lenientConfiguration.getArtifacts()) {
ModuleVersionIdentifier id = resolvedArtifact.getModuleVersion().getId(); ModuleVersionIdentifier id = resolvedArtifact.getModuleVersion().getId();
boolean projectDependency = projectDependencyIds boolean projectDependency = projectDependencyIds
.contains(id.getGroup() + ":" + id.getName() + ":" + id.getVersion()); .contains(id.getGroup() + ":" + id.getName() + ":" + id.getVersion());

Loading…
Cancel
Save