Reputation: 2056
Is it possible to specify project properties such as name in gradle.properties file so will be possible to access them from build.gradle by using project.name?
I've tried with no luck:
name=some
project.name=some
org.gradle.project.name=some
Upvotes: 2
Views: 1613
Reputation: 364808
You can do it.
For example in your root gradle.properties
file you can have:
VERSION_NAME=2.0.2
Then in your build.gradle file (in the root folder) you can have for example:
allprojects {
version = VERSION_NAME
}
If you would like to use it in your module build.gradle
file you can have:
android {
defaultConfig {
versionName project.VERSION_NAME
}
}
Upvotes: 1