gradle-dependencies-sorter
gradle-dependencies-sorter copied to clipboard
Allow a custom naming strategy
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" }
Thanks for the issue. How does this impact sorting dependencies?
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.
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.
Yep, exactly that.