Have a product flavor be a child of another

后端 未结 3 1233
灰色年华
灰色年华 2021-02-02 15:49

I\'m setting up the product flavors in my app and have run into one problem. Two of my product flavors are very similar to each other and only differ by a few resources, let\'s

3条回答
  •  面向向阳花
    2021-02-02 16:02

    I think you won't be able to do this in the android object directly, but you can use a configuration function to set common properties on a flavor. Put this after the android object:

    void configureWhiteLabelFlavor(flavor) {
        flavor.useJack = true
    }
    
    configureWhiteLabelFlavor(android.productFlavors.whiteLabelA)
    

    If needed, you can implement deep inheritance by calling other functions from this function.

提交回复
热议问题