定义变量:
gradle.properties
COMPILE_SDK_VERSION=25
BUILD_TOOLS_VERSION=25.0.0
TARGET_SDK_VERSION=23
MIN_SDK_VERSION=8
使用变量:
build.gradle中
apply
plugin:
'com.android.application'
android {
compileSdkVersion COMPILE_SDK_VERSION
as int
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion MIN_SDK_VERSION
as int
targetSdkVersion TARGET_SDK_VERSION
as int
}
转载请注明原文地址: https://ju.6miu.com/read-672646.html