I am defining productFlavors
in my build.gradle
file (the one in the app
directory). Each flavor has a corresponding res/raw
directory with .properties
files corresponding to the build type (debug, test, and release). Within my main/res/raw
directory, I have build.properties
. Here's a visual of the directory structure:
- src
- flavor1
- res
- raw
- dev.properties
- prod.properties
- test.properties
- raw
- res
- flavor2
- res
- raw
- dev.properties
- ...
- raw
- res
- ...
- main
- res
- raw
- build.properties
- raw
- res
- flavor1
I would like to copy the contents of <flavor>/res/raw/<build_type>.properties
into main/res/raw/build.properties
and only deploy build.properties
into the APK.
How can I determine which build variant is being built from within build.gradle
in order to copy the correct <build_type>.properties
file?
How can I exclude the <flavor>/res/raw
folder from being built into the APK?