730 B
730 B
Migration to Metro
The dependency injection library is now Metro. It replaces both Dagger and Anvil.
Migration of the current Element X code has been performed in https://github.com/element-hq/element-x-android/pull/5253.
To migrate other existing code you will need to:
- replace
setupAnvil()withsetupDependencyInjection()in yourbuild.gradle.ktsfiles - replace the Dagger and Anvil imports with Metro ones
- move the
@Injectapply to the constructor to the class itself (only applicable if there is only one primary constructor - replace
@AssistedInjectwith@Inject - replace
@Modulewith@BindingContainer
This should help to migrate your existing code.