openrewrite / rewrite-third-party

OpenRewrite recipes maintained by third parties.
Apache License 2.0
1 stars 1 forks source link

Add quarkus-update-recipes #2

Closed timtebeek closed 4 months ago

timtebeek commented 4 months ago

Adds quarkus-update-recipes

We likely still need to rename and move the .yaml files to fall under /META-INF/rewrite and end with .yml. Look at https://imperceptiblethoughts.com/shadow/configuration/merging/#merging-service-descriptor-files

As by default the yaml resources are not immediately in the typical location. image

timtebeek commented 4 months ago

So there's a few oddities here where there's two artifacts: https://repo1.maven.org/maven2/io/quarkus/quarkus-update-recipes/1.0.14/

The -core contains the usual META-INF/rewrite/ files (only), but they are suffixed .yaml, not .yml. This file also lacks the camel yaml recipes. The plain jar contains classes, and a /quarkus-updates/org.apache.camel.quarkus/camel-quarkus/3alpha.yaml file, but no META-INF/rewrite/ at all.

Both are quite awkward and not as easily shadowed into the output jar. There appears to be some support for relocation in Shadow, but that follows a package structure that incidentally also renames files, which does not play well with the paths listed above.

Any non-class files that are stored within a package structure are also relocated to the new location.

Attempts at using a com.github.jengelman.gradle.plugins.shadow.transformers.Transformer are so far unsuccessful.

timtebeek commented 4 months ago

Looks like .yaml files should not be an issue, given how we seem to load both extensions https://github.com/openrewrite/rewrite/blob/0893a6fcb3bcf315148cb2567039e745ccdc3428/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java#L120-L123