我有一个调试和发布版本类型。我也使用带有不同配置的productFlavour。现在如何检查productFlavour,如果是调试版本或发布版本?
signingConfigs {
release {
keyAlias '*****'
keyPassword '****'
storePassword '*****'
storeFile file('./config/keystore/Android***ReleaseKeyStore')
}
unsigned{
}
}
buildTypes {
debug{
runProguard false
buildConfigField "String", "ID", "\"00000\""
debuggable true**
}
release {
runProguard true
proguardFiles 'proguard-project.txt'
signingConfig signingConfigs.release
zipAlign true
debuggable false
}
}
productFlavors {
b2c {
applicationId 'com.foo.bar'
buildConfigField "String", "ID", "\"11111\""
if(debuggable){
buildConfigField "String", "ID", "\"22222\""
}
}
...