google / dagger

A fast dependency injector for Android and Java.
https://dagger.dev
Apache License 2.0
17.41k stars 2.01k forks source link

[KSP] dagger-android support #4044

Closed dniHze closed 9 months ago

dniHze commented 1 year ago

Congrats on the release of the first KSP milestone!

Just a quick question. Are there any plans to make dagger-android compiler compatible with KSP moving forward?

Thank you!

trevjonez commented 1 year ago

At the very least the "implicit module inclusion" behavior that enables dagger-android to work should be made a general behavior before discontinuing full support for dagger-android

That would unlock quite a bit of innovation while giving those that want to avoid hilt a path forward.

dniHze commented 1 year ago

TBH, I would be just happy getting a statement on it in the roadmap. We were thinking on replacing it with either vanilla Dagger or with Hilt. Not sure if it worth the effort for us to fork it and updating it support to updated compiler API.

bcorso commented 1 year ago

Yes, we will add KSP support for dagger-android now that Dagger and Hilt have been supported (see https://github.com/google/dagger/issues/2349#issuecomment-1331251151).

I don't anticipate this being a large amount of work, but it may still take a few weeks due to prioritization.

nitinsethi86 commented 12 months ago

I tried mixing dagger-android usage with kapt and main dagger usage with ksp. It does not compile. Is it expected?

I see a compile time error with just usage of ksp for plain dagger.

@ContributesAndroidInjector was used, but dagger.android.processor.AndroidProcessor was not found on the processor path

bcorso commented 12 months ago

Yes, unfortunately you won't be able to mix kapt dagger-android and ksp dagger in the same Gradle module because the dagger processor requires access to files generated by the dagger-android compiler.

Wrywulf commented 10 months ago

@bcorso Out of curiosity, will this issue be the one tracking the development of KSP support for dagger-android, or is there another?

bcorso commented 10 months ago

Yep, this is the one.

bcorso commented 10 months ago

Also, fwiw, we do have someone actively working on this now. We'll update this ticket when it's ready.

wanyingd1996 commented 9 months ago

Fixed with #4134

trietbui85 commented 9 months ago

@wanyingd1996 Do you know when will the Dagger 2.48.2 with dagger-android support be released?

bcorso commented 9 months ago

@trietbui85 the Dagger 2.49 release is now out.