Creating your own recipes with Builder
Moderne provides the ability to create custom recipes from our existing recipe catalog through Recipe Builder.
The Recipe Builder allows you to:
  1. 1.
    Import declarative recipes authored in YAML.
  2. 2.
    Export declarative recipes as YAML and include them in your project.
  3. 3.
    Remix existing recipes and configurations to meet your goals.
Let's build a custom recipe!

Step 1: Import an example recipe

Let's start with a simple recipe to import.
1
type: specs.openrewrite.org/v1beta/recipe
2
name: org.your_user_name.MyCustomRecipe
3
displayName: My custom recipe
4
description: Find instances of List.
5
recipeList:
6
- org.openrewrite.java.search.FindTypes:
7
fullyQualifiedTypeName: java.util.List
8
checkAssignability: true
Copied!
  1. 1.
    Click Import YAML to open the form
  2. 2.
    Paste in the contents of the recipe above.
  3. 3.
    Click import
    ​
    ​
  4. 4.
    Observe the Recipe List now contains our FindTypes recipe and configuration

Step 2: Change options

Once we have imported a recipe from YAML, we can make further modifications before running the recipe.
  1. 1.
    Click the Settings button (Gear) next to Find Types to open the recipe editor.
  2. 2.
    Change java.util.List to java.util.Set
  3. 3.
    Click Update
  4. 4.
    Observe in the Recipe Preview on the right side that the recipe configuration updated.

Step 3: Confirm repository selection

In the Recipe Meta Data form, you can select which repositories to include in the recipe run.

Step 4: Run recipe

Click Dry Run to execute your custom recipe and view the results.