Documenting dependencies with Because

Jaymin Nayak
2 min readMay 16, 2020

--

In the Android project, you often declare the dependencies, and also sometimes, when you’re working in a team environment or providing help for an app, you’ve identified some project dependencies and guess what you don’t know the reason why it’s here. There is no documentation or comment specified right? 🤔

Calm down , Because is here to rescue

Now, You can document dependency with Because.

When you declare the dependency, You can declare the custom reason along with it in the dependencies section.

Yeah, you can do it.

dependencies {
implementation('com.github.bumptech.glide:glide:4.11.0') {
because 'Glide supports fetching, decoding, and displaying video stills, images, and animated GIFs'
}
}

To verify, execute the Gradle command in the android Studio terminal.

./gradlew :app:dependencyInsight --configuration debugCompileClasspath --dependency glide

And you can see the reason in the Selection reasons section.

So, That’s all folks!

I hope you have found this article useful.

Thank you very much for reading! 🙂🙏🙏

If you found this story useful, don’t forget to press 👏 button and share it with other people so they can enjoy it as well.

Follow me on Twitter

--

--

Jaymin Nayak

Mobile Application Developer, Funny guy, Self-churner, Knowledge seeker, The Learner and Above all The Programmer