|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2021 the original author or authors. |
| 2 | + * Copyright 2012-2022 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
24 | 24 |
|
25 | 25 | import org.gradle.api.Project;
|
26 | 26 | import org.gradle.api.artifacts.Configuration;
|
| 27 | +import org.gradle.api.artifacts.LenientConfiguration; |
27 | 28 | import org.gradle.api.artifacts.ModuleVersionIdentifier;
|
28 | 29 | import org.gradle.api.artifacts.ResolvedArtifact;
|
29 | 30 | import org.gradle.api.artifacts.ResolvedConfiguration;
|
@@ -75,7 +76,11 @@ private static class ResolvedConfigurationDependencies {
|
75 | 76 | ResolvedConfigurationDependencies(Set<String> projectDependencyIds,
|
76 | 77 | ResolvedConfiguration resolvedConfiguration) {
|
77 | 78 | if (!resolvedConfiguration.hasError()) {
|
78 |
| - for (ResolvedArtifact resolvedArtifact : resolvedConfiguration.getResolvedArtifacts()) { |
| 79 | + LenientConfiguration lenientConfiguration = resolvedConfiguration.getLenientConfiguration(); |
| 80 | + // Ensure that all files are resolved, allowing Gradle to resolve in |
| 81 | + // parallel if they are not |
| 82 | + lenientConfiguration.getFiles(); |
| 83 | + for (ResolvedArtifact resolvedArtifact : lenientConfiguration.getArtifacts()) { |
79 | 84 | ModuleVersionIdentifier id = resolvedArtifact.getModuleVersion().getId();
|
80 | 85 | boolean projectDependency = projectDependencyIds
|
81 | 86 | .contains(id.getGroup() + ":" + id.getName() + ":" + id.getVersion());
|
|
0 commit comments