-
I'm evaluating the use of OpenRewrite in my organization. From what I can tell from this recipes tests, it is not designed to remove the configuration. For example, ---
type: specs.openrewrite.org/v1beta/recipe
name: GradlePlugins
displayName: Update and remove Gradle plugins
recipeList:
- org.openrewrite.gradle.plugins.RemoveBuildPlugin:
pluginId: com.github.ben-manes.versions This removes plugins {
id 'java'
id 'com.github.ben-manes.versions' version '0.36.0'
} as expected. However, it leaves the related plugin configuration, dependencyTrack {
projectName = project.name
projectVersion = project.ext.buildNumber
apiKey = project.property('dependency.track.api.key')
} Is there another recipe that I can run that removes the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
hi @nspyke ; Indeed that recipe does not remove any associated configuration just yet, as I don't think we have a clear link between those two. It should be fairly straightforward to write a recipe to remove the config as well; that's mapped as a method invocation, so could be removed with for instance this recipe: If that fails then a small dedicated recipe could work as well; you'll want to use GroovyVisitor, override visitMethodInvocation and |
Beta Was this translation helpful? Give feedback.
hi @nspyke ; Indeed that recipe does not remove any associated configuration just yet, as I don't think we have a clear link between those two. It should be fairly straightforward to write a recipe to remove the config as well; that's mapped as a method invocation, so could be removed with for instance this recipe:
rewrite/rewrite-java/src/main/java/org/openrewrite/java/RemoveMethodInvocations.java
Lines 27 to 52 in 4c870fa