Different app names for different build flavors?

前端 未结 9 1716
-上瘾入骨i
-上瘾入骨i 2020-12-07 11:07

I have 2 build flavors, say, flavor1 and flavor2.

I would like my application to be named, say, \"AppFlavor1\" when I build for flavor1 an

9条回答
  •  青春惊慌失措
    2020-12-07 11:29

    First of all, answer this question: "Can the user install both flavors of your application on the same device?"

    I use a Python script that patches the source. It contains some reusable functions and, of course, knowledge what needs be patched in this particular project. So the script is application-specific.

    There is a lot of patching, the data for patching are kept in a Python dictionary (including application package names, they BTW are different from the Java package name), one dictionary per flavor.

    As to l10n, strings may point to other strings, e.g. in my code I have:

    @string/x_app_name_xyz
    
    My Application
    My App
    

提交回复
热议问题