android tutorial - Use gradle properties in Android | Developer android - android app development - android studio - android app developement
Use gradle.properties for central versionnumber/buildconfigurations
You can define central config info's in
- a separate gradle include file Centralizing dependencies via "dependencies.gradle" file
- a stand alone properties file Versioning your builds via "version.properties" file
or do it with root gradle.properties file
the project structure
- global setting for all submodules in gradle.properties
usage in a submodule
Note: If you want to publish your app in the F-Droid app store you have to use magic numbers in the gradle file because else f-droid robot cannot read current versionnumner to detect/verify version changes.