Hacker News new | ask | show | jobs
by christop 2981 days ago
Unfortunately, using Dagger for DI with Kotlin requires using the Kotlin annotation processor, kapt, which is still incredibly slow, and works non-incrementally.

If you value your build times or your sanity in the slightest, I'd recommend either severely limiting use of Dagger, e.g. by only using it in certain, small Gradle modules, or using a different DI solution.

2 comments

I have only used Kotlin in the context of Android so far, and like the language — I wish Java had many of these features — but almost find it more of a pain in the ass than its worth for reasons like this (kapt). At some point, the build times get so bad I asked myself, am I being more productive having neat language features X,Y,Z or having 15sec build times (already too long) vs 2 minute build times (unbearable). Its like going from REPL driven development to something else.
Thanks for this tip. Don't know this.