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

Only add a Gradle wrapper if there is a Gradle project #4379

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

shanman190
Copy link
Contributor

What's changed?

Modify UpdateGradleWrapper to only generate a wrapper when it has deduced that there also exists a Gradle project within the source set.

What's your motivation?

When running the recipe with either the default or an explicit true value for the addIfMissing parameter will result in a new Gradle wrapper being generated at the root of the project, even if one doesn't make sense for the repository at hand.

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

Are there use cases where a Gradle wrapper may be desired and a Gradle project doesn't exist? 🤔

Anyone you would like to review specifically?

Anyone

Have you considered any alternatives or workarounds?

  • Use a precondition to gate the generation within upstream recipes
  • Be more selective when using the default or explicit true value for the addIfMissing parameter

Any additional context

N/A

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 3, 2024
@shanman190 shanman190 self-assigned this Aug 3, 2024
@sjungling
Copy link
Contributor

Thank you for this improvement!

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Great to see, thanks! Now we no longer have to remember not to add the wrapper to rewrite-maven-plugin 😁

@shanman190 shanman190 merged commit af4f5e6 into main Aug 3, 2024
2 checks passed
@shanman190 shanman190 deleted the fix/only-if-gradle-project branch August 3, 2024 17:51
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.

3 participants