I have many product flavors and 2 build types debug and release, I have a task to copy of /src/test/res
to testRootDir/res
, now I need a way to compute the value of testRootDir depending on buildVariant right now I have separate copy tasks for each build variant, for example product flavor demo and build type release, i have task that copies from /src/test/res
and puts it in ${buildDir}/intermediates/classes/test/demo/release/debug/res
This is not feasible as I would have to write separate copy task for each variant, how do I handle this?
EDIT
Current solution (In pseudo code, taken from RaGe's comment)
for each flavor, for each buildType
{ copy into $buildDir/something/$flavor.name/$buildType.name/res }
What I neeeed
But this solution is not complete as it will create multiple copies of res directories no matter which build variant is selected, I want to create copy task specific for the current build variant being built is this at all possible?