How can I add directories to a Gradle sourceset by wildcard pattern?

288 views Asked by At

I would like to separate various source types into per-module areas without either:

  1. adding a separate Android module project (or build.gradle) for each or
  2. explicitly adding each module's source directories to appropriate source sets in build

So thus for instance, what I really want to do are things like:

main {
  assets {
    srcDir 'modules/*/assets'
  }
}

and have modules/A/assets, modules/B/assets, etc, automatically added to the list of assets directories. But that does not work, unfortunately, nor is it clear how to produce/iterate a set of directories from a wildcard pattern.

0

There are 0 answers