我的应用有两个构建变体,一个是标准的应用版本,另一个是定制应用。
productFlavors {
customConfig {
minSdkVersion 14
applicationId 'es.com.custom'
targetSdkVersion 22
versionCode 3
versionName '3.0.0'
}
standard {
minSdkVersion 14
applicationId 'es.com.standard'
targetSdkVersion 22
versionCode 3
versionName '3.0.0'
}
为了进行定制化,我需要实现新功能,但只针对定制化,因此这些新功能将不会在标准版本中提供。我不确定该怎么做。
1.- 两个类,一个具有标准要求,另一个具有自定义要求
2.- 在标准类中执行以下操作:
if (getPackageName()==customConfig )
// do the custom things
else
//do the standard things