title: Resource merging during gradle builds with different approaches
body: <p>As we know there are two ways of having separate <code>res</code> directories for each <code>productFlavor</code> or <code>buildType</code>. </p>
  
  <p><strong>First Approach</strong> is by having separate directories under the <code>src</code> folder e.g. <code>src\flavor1\res</code>, <code>src\flavor2\res</code> etc.</p>
  
  <p><strong>Second Approach</strong> is specifying the <code>res</code> directory under <code>sourceSets</code> in the <code>build.gradle</code> like</p>
  
  <pre><code>sourceSets {
      main {
          res.srcDirs    = ['res']
      }
      dev {
          res.srcDirs    = ['res-dev']
      }
  }
  </code></pre>
  
  <p>I know for sure that resource merging will happen in the <em>first approach</em> and any missing resource in the separate directory for flavor will be picked up from the <code>main</code>'s sourceSet.</p>
  
  <p><strong>Question is about <em>second approach</em> above.</strong></p>
  
  <p>Will resource merging happen in the same way as it happens with the first approach using separate folders? Here i am explicitly going to assign a separate directory. Does it still fallback to main for resources not found in the specified directory?</p>
  
  <p>I ask this because of the example in <a href="http://tools.android.com/tech-docs/new-build-system/resource-merging" rel="nofollow">THIS LINK on http://tools.android.com/</a> where towards the end of the article it shows <code>'src/main/res'</code> being explicitly added as follows:</p>
  
  <blockquote>
  <pre><code>android.sourceSets {
     main.res.srcDirs = ['src/main/res', 'src/main/res2']
  }
  </code></pre>
  </blockquote>
  
  <p>Has anyone done this and knows if the resource merging will still happen if i just give the additional directory and not main as an additional one? will it fallback to the main directory for missing resources?</p>