Overview: Fundamentals of recipe development workshop
This workshop builds on the foundations covered in the Introduction to OpenRewrite workshop, but is focused on recipe development. It's designed to help you build the skills needed to customize and build OpenRewrite recipes. OpenRewrite is a framework for writing and running code transformations. Recipes are the unit of work in OpenRewrite, and can be written in YAML, Refaster, or imperative Java.
Throughout this workshop, you'll explore all three approaches to writing recipes, as well as how to test and validate recipe behavior so you can gain confidence developing recipes that apply safe, scalable changes across your codebase. This workshop is designed to be hands-on, so you can follow along with the examples in your own environment. The workshop consists of a series of modules that highlight key concepts, each with one or more exercises to help you practice what you've learned.
Be sure to also follow the links to the OpenRewrite documentation for more in-depth information. Feel free to skip around to the sections that interest you most, based on your needs and experience level.
If you get stuck or have questions, feel free to ask in the OpenRewrite Slack or Discord.
What you'll learn
- Setting up a recipe development environment
- Creating your own declarative YAML recipes
- Scoping recipes using preconditions
- Testing and validating recipe logic
- Using Refaster for pattern-based Java transformations
- How to write and run imperative Java-based recipes
Prerequisites
To get the most out of this workshop, you should at least be familiar with:
- Writing Java code
- Using build tools like Maven or Gradle
If you haven’t been through the Introduction to OpenRewrite workshop yet, we recommend completing it first before returning here.