openrewrite / openrewrite/rewrite
GradleParser correct Class/Method Type association for Kotlin
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 570
- Avg merge
- 13h 12m
- Merged PRs (30d)
- 261
Description
For Recipes like RemoveBuildPlugin we can use MethodMatcher patterns like:
RewriteGradleProject plugins(..)PluginSpec id(..)- ...
To match e.g. plugins
But for build.gradle.kts the J.MethodInvocation.methodType is simply null.
So recipes like RemoveBuildPlugin does not work for Kotlin DSL in build.gradle.kts
It would be great if we could tell the KotlinParser the "class-scope" of a build.gradle.kts, just like it is done via
For the GroovyParser
But I guess since the GroovyParser has a completely different implementation than KotlinParser this is not so straight-forward?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with rewrite-gradle/src/main/java/org/openrewrite/gradle/GradleParser.java around the class-scope handling referenced in the issue, then compare that implementation with KotlinParser. Reproduce the missing J.MethodInvocation.methodType for a build.gradle.kts example and verify that RemoveBuildPlugin method matchers work for Kotlin DSL calls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kotlin
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100