Can anyone explain to me how I can use for each of my flavors more then just the main and the flavor specific java/src directories ? My goal is to have directories which are
As described here
As mentioned above, each sourceSet can define multiple resource folders.
You can define multiple resource folder. For example something like this:
android {
...
sourceSets {
main {
//....
res.srcDirs = ['/src/main/res']
}
flavorA1 {
res.srcDirs = ['/src/flavor1/res', '/src/commonA/res']
}
flavorA2 {
res.srcDirs = ['/src/flavor2/res', '/src/commonA/res']
}
//.....other flavors
}
}
I've found a slightly different format is required for setting java source files
sourceSets {
favorA1 {
java {
srcDirs('src/favorA1/java/src', 'src/commonA/java/src')
}
}
favorA2 {
java {
srcDirs('src/favorA2/java/src', 'src/commonA/java/src')
}
}
}
Gradle Java
Gradle Source Api