I\'ve got an old eclipse project I\'ve moved into android studio and setup to use flavors. It seemed to be working fine till I started trying to use different java files be
You are welcome to use the custom sourceSets and flavours (or buildTypes) if you wish.
As an example, you can set them in your Gradle file as follows:-
productFlavors {
flavor2 {
}
flavor1 {
}
}
sourceSets{
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src/commonFiles/java']
resources.srcDirs = ['src/commonFiles/java']
aidl.srcDirs = ['src/commonFiles/java']
renderscript.srcDirs = ['src/commonFiles/java']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
flavor1 {
java.srcDirs = ['src-flavor1']
res.srcDirs = ['res-flavor1']
...
}
}