【Android】【配置文件】gradle和manifest的使用(五):gradle引用gradle

build.gradle引用config.gradle
在这里插入图片描述
config.gradle内定义变量

rootProject.ext {
    minSdkVersion = 23
    targetSdkVersion = 27
    compileSdkVersion = 27
    buildToolsVersion = '28.0.3'
}

build.gradle引用config.gradle

apply plugin: 'com.android.application'
apply from: "config.gradle"

android {

    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId 'com.easing.test'

        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
    }
}

你可能感兴趣的:(android)