1、Support版本統(tǒng)一管理(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