[英]How combine build type and flavor to get a build variant debug<Flavor>
Is there a way to combine build type and flavor to get build variant such that resources would be taken from most specific res folder? 有没有一种方法可以结合构建类型和风格来获取构建变体,以便从最特定的res文件夹中获取资源?
Lets say I have 可以说我有
src/main
src/debug
src/flavor1
src/flavor2
In my src/main
I have basic configuration. 在我的
src/main
我有基本配置。
In my src/flavor1
and src/flavor2
I have specific configurations and I want them to be overridden by values from src/debug
. 在我的
src/flavor1
和src/flavor2
我有特定的配置,我希望它们被src/debug
值覆盖。 But flavor values are more specific and src/debug
config is ignored. 但是风味值更具体,并且
src/debug
配置被忽略。
For example each flavor has @string/app_name
. 例如,每种口味都有
@string/app_name
。 Ie Flavor 1 App
. 即
Flavor 1 App
。 I want to override @string/app_name
with Flavor 1 App Dev
我想用
Flavor 1 App Dev
覆盖@string/app_name
Is there any way to get effect I want? 有什么方法可以达到我想要的效果吗?
You can use these folders 您可以使用这些文件夹
main
java
res
flavor1
java
res
flavor1Debug
java
res
flavor1Release
java
res
flavor2
java
res
flavor2Debug
java
res
flavor2Release
java
res
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.