Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GradleDependency trait #4394

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

shanman190
Copy link
Contributor

What's changed?

Added an implementation of the Trait api for Gradle dependencies

What's your motivation?

Having the same Trait api available for Gradle as was introduced for Maven.

Anything in particular you'd like reviewers to focus on?

Nothing in particular

Anyone you would like to review specifically?

Anyone

Have you considered any alternatives or workarounds?

None

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@shanman190 shanman190 added the enhancement New feature or request label Aug 7, 2024
@shanman190 shanman190 self-assigned this Aug 7, 2024
@shanman190 shanman190 force-pushed the feature/gradle-dependency-trait branch from 85c5d7a to 1e7e666 Compare August 7, 2024 20:02
Comment on lines +104 to +113
for (ResolvedDependency resolvedDependency : transitiveConfiguration.getResolved()) {
if ((groupId == null || matchesGlob(resolvedDependency.getGroupId(), groupId)) &&
(artifactId == null || matchesGlob(resolvedDependency.getArtifactId(), artifactId))) {
Dependency req = resolvedDependency.getRequested();
if ((req.getGroupId() == null || req.getGroupId().equals(dependency.getGroupId())) &&
req.getArtifactId().equals(dependency.getArtifactId())) {
return new GradleDependency(cursor, resolvedDependency);
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callout: I wasn't quite sure what should happen here, so I opted to just return the first ResolvedDependency encountered.

@sambsnyd sambsnyd merged commit e9cb8c7 into main Aug 7, 2024
2 checks passed
@sambsnyd sambsnyd deleted the feature/gradle-dependency-trait branch August 7, 2024 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants