-
Notifications
You must be signed in to change notification settings - Fork 41
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
Parsing of Gradle build files doesn't consider submodules #245
Comments
Thanks for helping dive in and debug @anuebel ; could you elaborate a bit on what you mean with "only considers the root project"? Which lines are you referring to there, and what change would you make to fix this? |
Only considering the root project in this case means, that only the build.gradle (and - if available - settings.gradle) of the root project are subject to recipe application. Gradle-targeting recipes like org.openrewrite.gradle.plugins.ChangePlugin will not be applied to build.gradle files of subprojects. In order for that to work i'd pass |
Thanks for sharing those details! Regarding that 403: I didn't yet see a fork of rewrite-gradle-plugin under your list of repositories at https://github.com/anuebel?tab=repositories. Perhaps pushing your changes to a fork helps you start a pull request here? That said I don't know if I'm the best judge of your proposed change; perhaps @shanman190 can weigh in here on your proposal, and how that might affect recipe runs? |
Thanks for the tag @timtebeek! Yes, the included patch is what I imagined would be the fix for the Gradle plugin given it's current state. @anuebel, as Tim suggested and assuming you are able to do so, creating a fork of the If you are unable to do this, that's fine and we can perform the necessary changes as well to fix this bug. |
I've submitted #250. Thanks for the help @shanman190 and @timtebeek. |
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I'm using the Gradle Plugin in a multi-module build.
What is the smallest, simplest way to reproduce the problem?
Create a multi-module Gradle build with root, submodule A and submodule B. All projects (root and submodules) apply plugin X. The goal is to remove plugin X by using the "org.openrewrite.gradle.plugins.RemoveBuildPlugin" recipe.
What did you expect to see?
Plugin X should get removed from all projects including root and submodules.
What did you see instead?
Plugin X has only been removed from the root build.gradle file.
Analysis so far
After debugging the current source code i found out that the method
org.openrewrite.gradle.isolated.DefaultProjectParser#parseGradleFiles
is actually called for all subprojects but doesn't take them into account. Instead the implementation only considers the root project.The text was updated successfully, but these errors were encountered: