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

Remove redundant versions for Gradle #4492

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

shanman190
Copy link
Contributor

What's changed?

Add recipe to remove redundant versions.

What's your motivation?

A similar feature is available in Maven.

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

Nothing in particular

Anyone you would like to review specifically?

Anybody

Have you considered any alternatives or workarounds?

Forcibly removing versions would result in broken builds.

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 recipe Requested Recipe label Sep 14, 2024
@shanman190 shanman190 self-assigned this Sep 14, 2024
@shanman190 shanman190 force-pushed the feature/gradle-remove-redundant-versions branch from 9381432 to a70e429 Compare November 27, 2024 21:34
@shanman190
Copy link
Contributor Author

The implementation here is now handling everything except for freestanding scripts which like the other recipes is also spotty for support anyway.

@timtebeek timtebeek self-requested a review November 27, 2024 21:46
@shanman190
Copy link
Contributor Author

The one failing test as described earlier.

RemoveRedundantDependencyVersionsTest > freestandingScript() FAILED
    java.lang.AssertionError: Recipe was expected to make a change but made no changes.
        at org.openrewrite.test.LargeSourceSetCheckingExpectedCycles.afterCycle(LargeSourceSetCheckingExpectedCycles.java:119)
        at org.openrewrite.RecipeScheduler.runRecipeCycles(RecipeScheduler.java:98)
        at org.openrewrite.RecipeScheduler.scheduleRun(RecipeScheduler.java:41)
        at org.openrewrite.Recipe.run(Recipe.java:378)
        at org.openrewrite.test.RewriteTest.rewriteRun(RewriteTest.java:376)
        at org.openrewrite.test.RewriteTest.rewriteRun(RewriteTest.java:132)
        at org.openrewrite.test.RewriteTest.rewriteRun(RewriteTest.java:127)
        at org.openrewrite.gradle.RemoveRedundantDependencyVersionsTest.freestandingScript(RemoveRedundantDependencyVersionsTest.java:216)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Requested Recipe
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants