gradle-dependencies-sorter icon indicating copy to clipboard operation
gradle-dependencies-sorter copied to clipboard

Allow a custom naming strategy

Open yschimke opened this issue 1 year ago • 4 comments

Repeating from https://github.com/pemistahl/version-catalog-linter-gradle-plugin/issues/2

it would be good to have a way to set a standard naming strategy, by default maybe the names used by Android Studio when you follow the hint to add a new TOML dependency.

And rename in both the TOML and build files.

--- apacheHttpClient = { group = "org.apache.httpcomponents", name = "httpclient", version = "4.5.14" }
+++ httpcomponents-httpclient = { group = "org.apache.httpcomponents", name = "httpclient", version = "4.5.14" }

yschimke avatar Jan 12 '24 08:01 yschimke

Thanks for the issue. How does this impact sorting dependencies?

autonomousapps avatar Oct 10 '24 20:10 autonomousapps

I'm trying to lazyweb my way to a feature I want :)

Maybe more appropriate for https://github.com/autonomousapps/dependency-analysis-gradle-plugin

But generally sorting when the TOML entries are a mix of

  • copy and pasted from existing proejcts
  • manually typed
  • Android Studio autocompleted

Is going to continue to be a mess, with androidx libraries in random places. This feature would be a power sort :)

Feel free to close as out of scope.

yschimke avatar Oct 11 '24 14:10 yschimke

Are you saying basically, not just sort the names as they currently exist, but change the names and also simultaneously update the version catalog to match those new names (also sorting the catalog, I imagine), as part of a new "power sort" feature?

If so, I recently did something like that for work, and it's very non-trivial :D

It's not really part of DAGP either, but more like the role of an orchestrator (convention plugin in the above case) that runs DAGP, this sorter, and then other customizations to achieve a well-defined final goal.

autonomousapps avatar Oct 11 '24 17:10 autonomousapps

Yep, exactly that.

yschimke avatar Oct 11 '24 21:10 yschimke