Skip to content

Commit

Permalink
Skip attempting to resolve "incrementalScalaAnalysis" configurations …
Browse files Browse the repository at this point in the history
…which have been problematic
  • Loading branch information
sambsnyd committed Oct 18, 2023
1 parent 56f1226 commit 08d7ff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -28,6 +28,7 @@

import static java.util.Collections.emptyList;

@SuppressWarnings("unused")
@Value
@With
public class GradleDependencyConfiguration implements Serializable {
Expand Down Expand Up @@ -118,6 +119,7 @@ public ResolvedDependency findResolvedDependency(String groupId, String artifact
.orElse(null);
}

@SuppressWarnings("DuplicatedCode")
public static Map<String, GradleDependencyConfiguration> fromToolingModel(Map<String, org.openrewrite.gradle.toolingapi.GradleDependencyConfiguration> toolingConfigurations) {
Map<String, GradleDependencyConfiguration> results = new HashMap<>();
List<org.openrewrite.gradle.toolingapi.GradleDependencyConfiguration> configurations = new ArrayList<>(toolingConfigurations.values());
Expand Down
Expand Up @@ -168,7 +168,8 @@ private static Map<String, GradleDependencyConfiguration> dependencyConfiguratio
.collect(Collectors.toMap(GradleProjectBuilder::groupArtifact, dep -> dep, (a, b) -> a));
// Archives and default are redundant with other configurations
// Newer versions of gradle display warnings with long stack traces when attempting to resolve them
if (conf.isCanBeResolved() && !"archives".equals(conf.getName()) && !"default".equals(conf.getName())) {
// Some Scala plugin we don't care about creates configurations that, for some unknown reason, are difficult to resolve
if (conf.isCanBeResolved() && !"archives".equals(conf.getName()) && !"default".equals(conf.getName()) && !conf.getName().startsWith("incrementalScalaAnalysis")) {
ResolvedConfiguration resolvedConf = conf.getResolvedConfiguration();
Map<GroupArtifact, ResolvedDependency> gaToResolved = resolvedConf.getFirstLevelModuleDependencies().stream()
.collect(Collectors.toMap(GradleProjectBuilder::groupArtifact, dep -> dep, (a, b) -> a));
Expand Down

0 comments on commit 08d7ff6

Please sign in to comment.