Hello, I tried finding a solution to connect the existing library DependencyComponent to Hilt ApplicationComponent. It looks like it is impossible at the moment.
Could you please clarify that.
Example:
we have the following gradle modules structure:
utils (library)
common (library)
feature1 (library, depends on common and utils)
feature2 (library, depends on utils)
app (application, assembles all modules above)
// from feature1 lib module
interface Feature1DependencyComponent {
val feature1Api: Feature1Api
}
// from app module
@Component(
dependencies = [Feature1DependencyComponent::class],
modules = [AppModule1::class, AppModule2::class]
)
@Singleton
interface ApplicationComponent {
val feature1Api: Feature1Api // to have explicit exposing
}
As you can see @Module can't be used in feature1 because it doesn't know anything about ApplicationComponent to use with @InstallIn.
Question: how to connect Feature1DependencyComponent without using @BindsInstance to Hilt ApplicationComponent?
Hello, I tried finding a solution to connect the existing library DependencyComponent to Hilt ApplicationComponent. It looks like it is impossible at the moment. Could you please clarify that.
Example: we have the following gradle modules structure:
As you can see
@Module
can't be used infeature1
because it doesn't know anything about ApplicationComponent to use with@InstallIn
.Question: how to connect
Feature1DependencyComponent
without using@BindsInstance
to Hilt ApplicationComponent?