Search code examples
androidgradletoml

What is the difference between using "module" versus "group" and "name" in toml files (gradle catalog)?


I'm migrating my Android project to gradle catalog, for a better management of dependencies. Documentation doesn't make it very clear, or I've missed something, but what is the difference between using these lines in your toml file:

androidx-core = { module = "androidx.core:core-ktx", version.ref = "vCore" }

versus:

androidx-core = { group = "androidx.core", name="core-ktx", version.ref = "vCore" }

I've read several articles about managing dependencies in gradle catalog, and usage seems to be quite random and incosistent. Are there any benefits of using either of those?

Thanks


Solution

  • No, they are exactly the same.
    Just like you can use implementation(group = "androidx.core", name = "core-ktx") or implementation("androidx.core:core-ktx") in a build script.
    This is just a question about preference and style.