-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Fix "Multiple builders are available" when syncing project in IDEA #17366
Conversation
There is a workaround that prevents adding a builder multiple times: https://git.io/JZLn1 This workaround relies on the fact that there is the `builders` field in the BuilderRegistry. The field was replaced with `registrations` in a recent commit so the workaround no longer works. This commit introduces a quick fix by providing `builders` field that is backed by the data in `registration`. Proper fix will probably require figuring out why the plugin is applied twice to the same Gradle instance.
@bot-gradle test this |
OK, I've already triggered ReadyForMerge build for you. |
@bot-gradle test and merge |
OK, I've already triggered a build for you. |
@mlopatkin I manually tested this with the sample project and I don't see the failure now. I also investigated why we're seeing the plugin applied multiple times. The problem isn't that the plugin is being mistakenly applied multiple times. Since Gradle 4.0, we run init scripts against included builds, so there are multiple instances of I think it's possible to greatly simplify what it's doing. I didn't fix the init script for Gradle versions older than 4.0, but I think it's possible to support those versions too. I think something like this is all that's needed:
But maybe as a first step, could we ask JetBrains to switch to using This has been available for ages, so backwards compatibility shouldn't be an issue. And then they can look at modifying the init script to be more like what I've put above. |
There is a workaround that prevents adding a builder multiple times:
https://git.io/JZLn1
This workaround relies on the fact that there is the
builders
field inthe BuilderRegistry. The field was replaced with
registrations
ina recent commit so the workaround no longer works.
This commit introduces a quick fix by providing
builders
field thatis backed by the data in
registration
.Proper fix will probably require figuring out why the plugin is applied
twice to the same Gradle instance.
Fixes #17319