在我的Android应用程序中,我有两个口味维度:“品牌”(brand1、brand2)和“环境”(staging、production)。一段时间后,我添加了“环境”维度,并且之前为不同品牌定义了一些
现在,我添加了“环境”维度,我想设置四个不同的端点:
谢谢
BuildConfig
变量。更具体地说,我像这样定义了BASE_URL
:flavorDimensions 'brand'
productFlavors {
brand1 {
dimension 'brand'
...
buildConfigField "String", "BASE_URL", "\"http://brand.one.api/\""
...
}
brand2 {
dimension 'brand'
...
buildConfigField "String", "BASE_URL", "\"http://brand.two.api/\""
...
}
}
现在,我添加了“环境”维度,我想设置四个不同的端点:
- Brand1-staging: "http://brand.one.staging.api/"
- Brand1-production: "http://brand.one.production.api/"
- Brand2-staging: "http://brand.two.staging.api/"
- Brand2-production: "http://brand.two.production.api/"
BuildConfig
变量。使用裸gradle是否可能?谢谢