Introduction To Gardening.

Hydroponic gardening is the developing of vegetations without soil, usually inside. If you've been actually gardening for any amount of time, you are actually most likely more knowledgeable than…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Design a version catalog using gradle toml file

As a Software Developer, working with Gradle-based projects, you must have followed many models of dependency sharing, all had a few bad aspects associated with them, to make this article very short and precise, we do not go into comparisons, will rather focus on the most modern, advanced and a sort of official sharing mechanism.

Most probably you will be aware of these three methods for dependency management so far

It was always tough in above mentioned three ways to maintain the dependencies, each method had its own problem. The few biggest benefits of having a catalog toml file are, that it looks very natural, IDE provides IntelliSense, and dependencies have a very understandable naming structure.

Example file:

You will place your libs.versions.toml file in the main gradle/libs.versions.toml

Usage and changes required in project:

app/build.gradle.kts will look like this

Project level build.gradle.kts file will look like this

settings.gradle.kts will look something like this

You can see how managed your libraries are looking in perfect shape which you can share with confidence and with many other advantages.

I’ve also created a very basic hello world android application demonstrating very basic example how you can use Gradle versions catalog and changes required in your project

Some useful resources

I wish it can help you in your next project or even your current one. I will come up in the next article that is going to be part of the versions catalogs with more use cases. Till then, Bye :)

Add a comment

Related posts:

Steel Strapping

Stainless steel strapping is used to secure materials in a variety of applications. These include bundling, load stabilization, unitizing, bailing wire and more. It also helps prevent damage to…

Are Doctors or Musicians More Beneficial to Society?

If you were on a sinking boat, would you get rid of a doctor or a musician to stop the boat from sinking? Most would probably get rid of the musician!

Buy Facebook Accounts

Social media platforms have become an essential component of our daily lives. Among these platforms, Facebook has emerged as a leading player, with over 2.8 billion active users worldwide. For…