5/10/2023 0 Comments Productflavors![]() If this solution helped you in some way, or if you know a better way to achieve this, please add a comment here below. Then, we need a task to use the ext.server dictionary and set the buildConfigValue accordingly: I created a “server” variable that is a dictionary, where the key is the build type and the value is the server URL that this variant (flavor+buildType) must use. I don’t have much experience with Groovy (Gradle language), but I used David’s idea to have ext values in each flavor. But I prefer to keep using buildTypes as I feel it’s semantically more accurate than having development and production flavors too. To achieve this goal, I found on web a similar config in David Medenjak’s blog, that uses flavors with ext values to dynamically config the value of BuildConfig.URL. To reduce the number of lines required to describe a Product Flavor with dimension site, an. Also we use a development server and a production server, so I came to this problem, because there is no way to set a buildConfigField for each variant (company1Debug, company1Release, company2Debug, …), but only for builtType OR productFlavor. When developing an Android app I had the need of setting different server URL for each flavor, because it has a server instance for each company that uses our product. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |