google / dagger

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

Feature request: Detect unused modules #4491

Open NikolayMetchev opened 2 days ago

NikolayMetchev commented 2 days ago

I have been trying to find a way to check that there are no unused modules in any of the Components I have defined. Ideally the check would be transitive and find any unused modules in the whole hierarchy of modules.

I came across DaggerKotlinIssueDetector but I couldn't figure out how that class is supposed to be used to lint Dagger projects or if it would actually detect the problem of unused modules.

Removing unused modules should greatly help reducing bloat and build times.

Any help will be much appreciated.

NikolayMetchev commented 2 days ago

I found a solution: https://github.com/SchwarzIT/dagger-lightsaber