How can I create tests with Anvil that use a test ...
# squarelibraries
e
How can I create tests with Anvil that use a test Dagger component in a library module (Gradle sub project)? The problem is that I want to use
generateDaggerFactories.set(true)
but I need the Dagger compiler to process the Dagger component for the test. I end up either with duplicate factories (Dagger and Anvil will both create them) or missing Dagger component if the Dagger compiler isn't running.
r
The Anvil config unfortunately isn’t that granular and the setting can only be changed on a module level, whereas you want to change it based on Kotlin compilation level. For now I suggest to use KAPT in this module and set this option to false.
gratitude thank you 1