I create a simple project in AndroidStudio with a few modules. Each module\'s gradle script contains the following code:
android {
compileSdkVersion 18
Create a custom property for your project. To set a single property use:
project.ext.compileSdkVersion = 21
to set multiple properties use:
project.ext {
compileSdkVersion = 21
buildToolsVersion = "21.0.1"
targetSdkVersion = 21
}
There is a new way simpler method, in the updated Android Studio. You have a file named "gradle.properties" in the top project hierarchy exactly for that. Simply define your parameters there:
common_parameter='I am common"
And use it in the modules' gradle files (build.gradle) as such:
module_parameter = common_parameter
That's it.