Here's my main project structure:
App/src
- main
- flavor1
- flavor2
- dimension1
- dimension2
- debug
- release
Both flavor* and dimension* are flavor dimensions. The build variants are:
flavor1Dimension1Debug
flavor1Dimension2Debug
flavor2Dimension1Debug
...
And library's dir structure:
Lib/src
- main
- flavor2
- DebugInterceptor.java
- debug
- DebugInterceptor.java
- release
- DebugInterceptor.java
What I want:
- if variant contains 'flavor2', this variant should use
src/flavor2/DebugInterceptor.java. It should take higher priority than build types. You can assume that these three dirs(flavor2, debug, release) contain only one fileDebugInterceptor.java - o.w. merging by default build rules.
How can I configure gradle to achieve this?