Use of TOML and KTS for better dependency management

I was going through the compose samples uploaded by google and at the JetSurvey application code. Great place to learn about Compose but the gradle structure intrigued me very much . When developing multi module applications its a good practice to create common variables / references for dependency versions. The tech community calls this as the version catalog.
Apache Groovy — the language previously used in gradle files had the option to add variables in the below format. We need to add this in the top level gradle file.
You can use these variables like $versions.material in the module level gradle files.
In recent times we use kotlin scripts which is loved all over by the developer community . Here the ability to add kotlin files in src folder of a module and use it in the gradle file is amazing.
Reference: https://github.com/philipplackner/CalorieTracker
But this has lot of work to do which everyone do not have ample time for. We need an out of the box solution .
Hence we need TOML files . TOML stands for Tom’s Obvious, Minimal Language. Its an Configuration file which can be converted to table by language which read it. Gradle started supporting it stable from 7.4.2. All we have to do is to add the TOML file into the gradle folder and the build system automatically generates code for it. In the package org.gradle.accessors.dm
We get a class LibrariesForLibs which has all the mentioned variables .
The usage can be done by referring the LibrariesForLibs using the libs keyword. Eg: libs.android.gradlePlugin This would return a Provider<MinimalExternalModuleDependency> object can be used to retrieve the information of the dependency.
Ref:https://funkymuse.dev/posts/toml-gradle/
Note: The best part of TOML is that we would be able to automate the dependency update task using 3rd party libraries. Check out the JetSurvey sample from google.