-
Notifications
You must be signed in to change notification settings - Fork 465
Add GradlePlugin trait #5574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GradlePlugin trait #5574
Conversation
9b61b8b
to
a33a494
Compare
It would be most ideal that the FieldAccess and Identifier cases were able to specify the full class name via type attribution. Unfortunately, the types weren't available even after adding the OpenRewrite plugin to the classpath. I didn't feel comfortable either with forcing the class name in from either value due to the possibility of all other kinds of code combinations that could arise from real world usage. TODOs:
|
rewrite-gradle/src/test/java/org/openrewrite/gradle/trait/GradlePluginTest.java
Outdated
Show resolved
Hide resolved
rewrite-gradle/src/test/java/org/openrewrite/gradle/trait/GradlePluginTest.java
Show resolved
Hide resolved
I think this is awesome! |
rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/Traits.java
Outdated
Show resolved
Hide resolved
rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java
Outdated
Show resolved
Hide resolved
rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java
Show resolved
Hide resolved
void alias() { | ||
rewriteRun( | ||
spec -> spec.recipe(RewriteTest.toRecipe(() -> new GradlePlugin.Matcher().asVisitor(plugin -> SearchResult.found(plugin.getTree())))), | ||
toml( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should have a gradleVersionCatalog() or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely a good candidate for a potential helper method. The default file name that is picked up automatically by Gradle is gradle/libs.versions.toml
, so we'd probably align in some capacity to that if we chose to adopt such a helper.
What's changed?
Added a trait implementing to find direct and transitive Gradle plugins and relevant information about them.
What's your motivation?
More traits? 😆
Anything in particular you'd like reviewers to focus on?
Nothing in particular
Anyone you would like to review specifically?
Anybody.
Have you considered any alternatives or workarounds?
N/A
Any additional context
Checklist