Slack

Extending Anvil for Fun and Profit

Jul 20, 2021
Extending Anvil for Fun and Profit
SummaryAI, from the source post

This post details the extension of Anvil's compiler API to automatically generate Dagger wiring code for Activities. It introduces a custom `CodeGenerator` that hooks into the compiler to detect `@InjectWith` annotations and generate `AnvilInjector` and `InjectorBinder` classes. This eliminates manual boilerplate for Activity injection and removes the need for `dagger-android-processor` and kapt for this specific use case, further reducing build times.

More from the Android Non-Transitive R Class Migration trail