2

In my init.gradle file, I have defined 2 active recipes.

    rewrite {
      activeRecipe("org.openrewrite.java.testing.mockito.Mockito1to4Migration", "com.myorg.openrewrite.Mockito1to4Migration")
    }

When running gradle -I init.gradle rewriteRun, it seems that the recipe com.myorg.openrewrite.Mockito1to4Migration is run first regardless of the position in the activeRecipe list.

Is the sequence random? How can I force that com.myorg.openrewrite.Mockito1to4Migration is run first.

MGK
  • 101
  • 5
  • Sorry to see this question was missed before; have you since found a way to make it work for yourself? The team is slightly more active on Slack, although there's now an integration to get notified about any new questions here as well. – Tim Jan 04 '23 at 16:26
  • No, I did not find a way up to now. – MGK Jan 18 '23 at 14:00

1 Answers1

0

A change has been push just now that preserves the order of active recipes. This change should end up in release 5.35.0+ of the Gradle plugin; with 5.34.0 released just a couple days ago, I would typically expect the next release in two to three weeks.

Until the next release becomes available, order can be maintained by having a single active recipe, which is a yaml recipe which declares each of the recipes you want to run in order.

Hope that helps!

Tim
  • 19,793
  • 8
  • 70
  • 95