title: Exclude assets for release build type
body: <p>I'm importing an android library in an application built with gradle, like that:</p>
  
  <pre class="lang-json prettyprint-override"><code>dependencies {
      compile 'com.example:great-lib:0.1-SNAPSHOT'
  }
  </code></pre>
  
  <p>This library contains only assets, js, css and images to be used in a webview, with a layout like that:</p>
  
  <pre><code>assets/
  |-&gt; great.css
  |-&gt; great.min.js
  |-&gt; great.min.js.map
  |-&gt; js/
  |   |-&gt; plop.js
  |   |-&gt; foo.js
  |   ...
  |-&gt; img/
  |   ...
  </code></pre>
  
  <p>The <code>js</code> folder contains source files (to be used with source maps). I would like to include it and the <code>.map</code> file for the debug builds, and have only the minified js in release builds, but I can't find a way to do that.</p>
  
  <p>So far I've tried : </p>
  
  <pre class="lang-json prettyprint-override"><code>android {
      // this doesn't exclude anything
      packageOptions {
          exclude 'assets/js'
      }
      buildTypes {
          release {
              // this does exclude the js folder, but in both release and debug
              aaptOptions {
                  ignoreAssetsPattern "!js"
              }
          }
      }
  }
  </code></pre>
  
  <p>Any idea if what I want is possible to achieve, and if so how?</p>
  
  <p>(I've also thought of publishing two versions of the library (<code>great-lib</code> and <code>great-lib-debug</code>), and have the dependency in <code>debugCompile</code> and <code>releaseCompile</code>, but I'd prefer avoiding that and publishing a single version)</p>