openrewrite / rewrite-gradle-plugin

OpenRewrite's Gradle plugin.
Apache License 2.0
60 stars 37 forks source link

Add check to make sure rewriteImplementation has not already been exended #284

Closed blipper closed 6 months ago

blipper commented 6 months ago

What's changed?

This allows run parsing to run multiple times

What's your motivation?

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

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

timtebeek commented 6 months ago

Thanks for the immediate suggested fix, and showing how you'd use this in

Noticed that we currently see a compilation failure after adding this method:

> Task :plugin:compileJava FAILED
Compiling with JDK Java compiler API.
/home/runner/work/rewrite-gradle-plugin/rewrite-gradle-plugin/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java:1078: error: cannot find symbol
                if (!rewriteImplementation.extendsFrom.contains(implementation)) {
                                          ^
  symbol:   variable extendsFrom
  location: variable rewriteImplementation of type Configuration

So I've pushed up a small change to conform to use getExtendsFrom(); hope you agree.

blipper commented 6 months ago

Sorry. I wrote the fix in groovy and cut and paste into java.

timtebeek commented 6 months ago

No worries; I figured as much from looking at the syntax. The last remaining test failure is a known one still to be fixed

Thanks for this fix!