Skip to content

Commit

Permalink
Only continue for matching configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Jan 23, 2025
1 parent a781af6 commit e1469b6
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public String getInstanceNameSuffix() {
@Override
public String getDescription() {
return "A common example is the need to change `compile` to `api`/`implementation` as " +
"[part of the move](https://docs.gradle.org/current/userguide/upgrading_version_6.html) to Gradle 7.x and later.";
"[part of the move](https://docs.gradle.org/current/userguide/upgrading_version_6.html) to Gradle 7.x and later.";
}

@Override
Expand All @@ -96,7 +96,11 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu
GradleDependency.Matcher gradleDependencyMatcher = new GradleDependency.Matcher()
.configuration(configuration);

if (!gradleDependencyMatcher.get(getCursor()).isPresent() && !dependencyDsl.matches(m)) {
boolean matchesConfiguration = gradleDependencyMatcher.get(getCursor()).isPresent();
if (!matchesConfiguration && configuration != null) {
return m;
}
if (!matchesConfiguration && !dependencyDsl.matches(m)) {
return m;
}

Expand Down

0 comments on commit e1469b6

Please sign in to comment.