openrewrite / rewrite-gradle-plugin

OpenRewrite's Gradle plugin.
Apache License 2.0
65 stars 41 forks source link

refactor: Update Gradle wrapper #295

Closed shanman190 closed 3 months ago

shanman190 commented 8 months ago

Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.gradle.UpdateGradleWrapper?organizationId=T3BlblJld3JpdGU%3D

shanman190 commented 8 months ago

The UserInputHandler class has had some modifications for Gradle 8.7 as it appears the Gradle team is beginning to clean up the API a bit in an effort to make a public API version of the feature available. This will presently require a version check to make the OpenRewrite plugin compatible with the new version.

timtebeek commented 6 months ago

Adding the details here to save others a click:

Compiling with JDK Java compiler API.
/home/runner/work/rewrite-gradle-plugin/rewrite-gradle-plugin/plugin/src/main/java/org/openrewrite/gradle/isolated/ui/RecipeDescriptorTreePrompter.java:62: error: cannot find symbol
                prompted = prompter.askQuestion(query.toString(), "");
                                   ^
  symbol:   method askQuestion(String,String)
  location: variable prompter of type UserInputHandler

https://github.com/openrewrite/rewrite-gradle-plugin/blob/6121f79f122f69f09457734ee9fd28a5888493db/plugin/src/main/java/org/openrewrite/gradle/isolated/ui/RecipeDescriptorTreePrompter.java#L59-L62

shanman190 commented 6 months ago

I'm honestly kinda surprised that more folks haven't reported this issue. It kinda makes me think that the rewriteDiscover task tends to not be utilized at all.

timtebeek commented 6 months ago

Yes I'm thinking the same: that task and the equivalent in the Maven plugin are likely not used much, if at all. They can be useful when troubleshooting I suppose, but there's less of a need for that now that we suggest the closest match too

We could remove these if we don't feel like maintaining these goals going forward. I doubt a knowledgeable user would need them, nor if a novice use would find them.