*How do I deal with Dagger when going multuplatfor...
# dagger
u
How do I deal with Dagger when going multuplatform? Obviously it cannot be in common, but I already have a project written and @Inject constructors everywhere Should I remove @Inject ctors and move to a @Module which would live in androidMain? Or is there a way to bend it so I don"t have to rewrite source? i.e. keep the @Inject annot. in common and somehow just expect actual it?
s
Do you have to use Dagger or could you use kotlin-inject as well? IIRC, kotlin-inject supports the same DI annotations.
u
I want to try kmm on a "side feature", dont want to migrate whole huge codebase first
p
Unfortunately the code dagger generates is java. It will only be valid code in desktop and Android targets.
u
I know, I want to actually run it in on android, but dagger uses ctor annotations
h
u
I dont want to change the library. I only want to not have it in common. But that means to remove the annotation. Or is there a way to expect actual it?
p
I see what you mean. I believe you can do that yes, expect/actual the annotation.