Different drawable based on build variant in Gradle

后端 未结 1 1626
再見小時候
再見小時候 2020-12-16 23:37

I have two flavors in my gradle file: flavor1 and flavor2. Along with the build types, they create the following build variants:

flavor1-debug
flavor1-releas         


        
相关标签:
1条回答
  • 2020-12-17 00:07

    There are actually additional sourceSets that are available. You can do this:

    src
     |__ main
     |__ flavor1
     |__ flavor1Debug
     |__ flavor1Release
     |__ flavor2
     |__ flavor2Debug
     |__ flavor2Release
     |__ debug
     |__ release
    

    which I think will give you what you want -- inside one of the flavor + build type folders, you can have your variant-specific resource in the appropriate resource subdirectory.

    See the docs at http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Sourcesets-and-Dependencies for more information.

    0 讨论(0)
提交回复
热议问题