I want to add a specific feature only when I am in debug mode build type (Android studio / gradle).to limit a set of class and resource to the debug build type (gradle).
My current solution is to use the debug directory to store the extra classes and resources and, in the code, to load the entry class by reflection when the BuildType.DEBUG property is set to true. The debug directory is merged with the main directory during the build if we are building in debug. I thought first that this directory will work the same as build variant ones, ie : will overwrite classes with the same name (permitting me to have a debug version of a specific class). It seems to be not possible (duplicate class error from Android Studio).
Is it the cleanest solution ? Is it possible to use gradle directly to do that ?