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:
compile fileTree(dir: 'libs', include: '*.jar')
But if I include all aar files like this:
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
I get an error:
Only Jar-type local dependencies are supported. Cannot handle: /path/to/file.aar
However it is possible to include each file separately like this:
compile (name:'myfile', ext:'aar')
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:
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])