1、Support版本统一管理(google工程师使用方法)
ext.supportLibVersion = '24.2.0'
dependencies {
compile "com.android.support:palette-v7:${supportLibVersion}"
}
2、BuildConfig使用
buildTypes {
release {
buildConfigField "boolean", "LOG", "false"
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources false
proguardFiles 'proguard-rules.pro'
}
debug {
buildConfigField "boolean", "LOG", "true"
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
proguardFiles 'proguard-rules.pro'
}
}
如上,则定义一个LOG变量,relase是false,debug是true,使用时候用BuildConfig.LOG