title: Android Studio include all aar files in a directory
body: <p>I'm writing a build system for a framework which can be extended via plugins by users (developers). My problem is that I can't include all aar files with a mask. For example I can include all jar files like this:</p>
  
  <pre><code>compile fileTree(dir: 'libs', include: '*.jar')
  </code></pre>
  
  <p>But if I include all aar files like this:</p>
  
  <pre><code>compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>Only Jar-type local dependencies are supported. Cannot handle: /path/to/file.aar
  </code></pre>
  
  <p>However it is possible to include each file separately like this:</p>
  
  <pre><code>compile (name:'myfile', ext:'aar')
  </code></pre>
  
  <p>As a workaround, during the build, I will need to list the files in 'libs' directory, insert all the libraries manually into my build.gradle and keep it in sync (or rewrite each time). it's a hackish way of doing it and thus I wonder if there is a better way of doing it. Maybe there is a gradle script which can do it automatically or some gradle beta which supports this: </p>
  
  <pre><code>compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
  </code></pre>