Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dependencies versions as variables for easier maintenance and better readability #7

Open
wahibhaq opened this issue Jan 17, 2018 · 0 comments

Comments

@wahibhaq
Copy link
Collaborator

wahibhaq commented Jan 17, 2018

Its a widely known best practice among android folks to avoid hardcoding version numbers of dependencies inside app/build.gradle. Instead its recommended to store it either in root build.gradle or in the same gradle file but as variables and then refer these variables.

It makes it much easier to update because then you can reuse one variable in different dependency and also easier to read for other contributors.

For example in root build.gradle

supportLib = '27.0.2'

and in app/build.gradle

// App's support dependencies
  implementation "com.android.support:appcompat-v7:$rootProject.supportLib"
  implementation "com.android.support:support-v4:$rootProject.supportLib"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant