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
Hilt - Dagger SPI plugins are not called since 2.40 due to flipping of enableAggregatingTask
to true
by default
#3464
Comments
Thanks for the sample app! If you need a workaround and are willing to have some Gradle script workaround then you can add the SPI plugin dependency to the annotation processor path of the JavaCompile task that Hilt creates when aggregation is turned ON. You can do this by first creating a config where you'll put the SPI plugins, then find the task and add it to the processor path, in your sample project it would be like this:
But note that translating to a bigger project might be trickier if for example you have configuration caching turned on. |
Great thanks for sharing that. Fortunately I have been using a gradle plugin to ship my SPI plugin so I could include this fix for hilt versions this issue appears. I will have to investigate to make this config cache compatible. |
…e task. Without including user added dependencies to those configurations, SPI plugins and other processors are not discovered and will not be invoked when running Dagger's ComponentProcessor. Fixes #3464 RELNOTES=Fix an issue where SPI plugins were not being invoked with Hilt's Gradle Plugin aggregation turned ON. PiperOrigin-RevId: 461959499
…e task. Without including user added dependencies to those configurations, SPI plugins and other processors are not discovered and will not be invoked when running Dagger's ComponentProcessor. Fixes #3464 RELNOTES=Fix an issue where SPI plugins were not being invoked with Hilt's Gradle Plugin aggregation turned ON. PiperOrigin-RevId: 461959499
Just want to touch base here, as it looks like this ticket is now closed. SPI plugins still don't appear to work with the aggregating task on in 2.43.2, though I can confirm that the suggested workaround works for me. I used Arunkumar's sample above to reproduce in isolation. Are things working as expected or is a fix expected in the future? |
Hey, thanks for checking, looks like the Hilt Gradle plugin is not correctly finding the You might be able to workaround this by declaring the SPI Plugin in the I'll try to fix the issue for KAPT plugins. |
Thanks so much @danysantiago! |
Hi @danysantiago, just double-checking if there has been any progress here since August, or if another workaround available. Currently seeing the following error:
|
…avac compile task. This change also moves the creation of the hiltAnnotationProcessor configuration earlier since creating it during task configuration is not required and can lead to some issues if the configuration contained is locked. Updated the SPIPluginTest.kt to verify behaviour with KAPT. Fixes #3464 RELNOTES=N/A PiperOrigin-RevId: 511799130
Hey - Sorry for dropping this and taking soo long, I was able to find cause and created a change: #3759 The warning is a false positive, indeed if you only have Once the fix lands, using only |
No problem about the delay, life happens! Thank you for the additional background and the fix 🙏 |
…avac compile task. This change also moves the creation of the hiltAnnotationProcessor configuration earlier since creating it during task configuration is not required and can lead to some issues if the configuration contained is locked. Updated the SPIPluginTest.kt to verify behaviour with KAPT. Fixes #3464 RELNOTES=N/A PiperOrigin-RevId: 511799130
…avac compile task. This change also moves the creation of the hiltAnnotationProcessor configuration earlier since creating it during task configuration is not required and can lead to some issues if the configuration contained is locked. Updated the SPIPluginTest.kt to verify behaviour with KAPT. Fixes #3464 RELNOTES=N/A PiperOrigin-RevId: 511799130
…avac compile task. This change also moves the creation of the hiltAnnotationProcessor configuration earlier since creating it during task configuration is not required and can lead to some issues if the configuration contained is locked. Updated the SPIPluginTest.kt to verify behaviour with KAPT. Fixes #3464 RELNOTES=N/A PiperOrigin-RevId: 511799130
BindingGraphPlugin.visitGraph()
is not called in hilt since 2.40 but worked till 2.39.1. DisablingenableAggregatingTask
manually via gradle extension fixes the issue.Repro https://github.com/arunkumar9t2/dagger-spi-issue
The text was updated successfully, but these errors were encountered: