How is the Android "productFlavors" mechanism implemented?

You would define an extension type with a container as a property. You can take a look at an example of what that might look like here: