Generate OpenRewrite recipes with JavaParser.Builder#classpathFromResources#1918
Conversation
|
Looks good. No mutations were possible for these changes. |
1 similar comment
|
Looks good. No mutations were possible for these changes. |
Which is odd, since I'm explicitly setting that as supported option here: 🤔 |
eeeb4f3 to
aa9693d
Compare
|
The issue manifested only with JDK 25. I rebased and added a commit to move the config to the proper location. But now there's another error you may want to look at. (I just did this in between meetings; can circle back later.) |
|
Thanks yes can confirm; I think it's because over here we use a lib for the annotations, whereas in our tests we had those inlined. Ought to be fixed with a small adjustment to the template processor and a new release. |
|
Looks good. No mutations were possible for these changes. |
1 similar comment
|
Looks good. No mutations were possible for these changes. |
|
Looks good. No mutations were possible for these changes. |
1 similar comment
|
Looks good. No mutations were possible for these changes. |
Stephan202
left a comment
There was a problem hiding this comment.
Nice! I added one commit. I checked the generated code; LGTM.
Suggested commit message:
Generate OpenRewrite recipes with `JavaParser.Builder#classpathFromResources` (#1918)
classpathFromResources for OpenRewrite recipesJavaParser.Builder#classpathFromResources
JavaParser.Builder#classpathFromResources JavaParser.Builder#classpathFromResources
|
Looks good. No mutations were possible for these changes. |
|
Looks good. No mutations were possible for these changes. |
|
Any concerns here @rickie ? Would love to get this in to make the corresponding changes on our end. |
| <groupId>org.openrewrite.recipe</groupId> | ||
| <artifactId>rewrite-recipe-bom</artifactId> | ||
| <version>3.16.0</version> | ||
| <version>3.17.0</version> |
89624d4 to
6a68d73
Compare
|
Looks good. No mutations were possible for these changes. |
Add a annotation processor argument to switch to classpath from resource for the generated OpenRewrite recipes:
https://github.com/openrewrite/rewrite-templating/?tab=readme-ov-file#use-javaparserbuilder-classpathfromresourcesctx-guava-31
Right now we're having to replicate the provided dependencies in EPS in rewrite-third-party to get the recipes to work at all, and even then they do not work well in all environments. By switching to type tables we only need to capture the public APIs of the dependencies, for a much smaller and safer runtime.
Follows
classpathFromResourcesin recipes generated for Refaster rules openrewrite/rewrite-templating#139classpathFromResourcesfor types referenced from types used openrewrite/rewrite-templating#160