dependency-analysis-gradle-plugin icon indicating copy to clipboard operation
dependency-analysis-gradle-plugin copied to clipboard

Use Gradle Version Catalogs if present

Open inktomi opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

In a large project which makes use of version catalogs, it would be ideal if instead of suggestions like "add implementation 'androidx.activity:activity:1.4.0'" the plugin was able to resolve the dependency name from the gradle version catalog and instead report "add implementation libs.androidx.activity".

Describe the solution you'd like

If there is a version catalog present, instead of reporting the raw dependency, look for a match in the catalog's items. There are methods off VersionCatalog which might be useful here.

Describe alternatives you've considered

The alternative would be not doing this, which is reasonable - and perhaps there is not the API support from Gradle itself to do this reverse lookup. It'd be unfortunate though, as this lookup would make the suggestions and automatic fixes much more usable for projects using version catalogs.

inktomi avatar Sep 28 '22 23:09 inktomi