How to define version property in gradle
Issue #351
From Gradle tips and recipes, Configure project-wide properties
For projects that include multiple modules, it might be useful to define properties at the project level and share them across all modules. You can do this by adding extra properties to the ext block in the top-level build.gradle file.
1 | ext { |
Versions are used mostly in dependencies
block so having them defined in global ext
is not quite right. We can use def
to define variables
1 | dependencies { |
For better namespacing, we can use a class
1 | class Version { |