How to define common android properties for all modules using gradle

Viewed 44666

I create a simple project in AndroidStudio with a few modules. Each module's gradle script contains the following code:

android {
    compileSdkVersion 18
    buildToolsVersion "18.1.1"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 18
    }
}

How can I move this code to the main build.gradle script (project's script)? This code is common for all the submodules.

8 Answers
Related