How can I dynamically create the PrebuiltLibraries collection?

I’m playing with the native-binary support in gradle 2.3-rc-1, and I was wondering how I can create the ‘NamedDomainObjectCollection’ that is being used to configure ‘repositories.libs(PrebuiltLibraries)’? I guess I don’t know what types I can specify for this. ‘NamedDomainObjectCollection&ltPrebuiltLibrary>’? But, ‘PrebuiltLibrary’ is an interface? I guess I am looking for a ‘PrebuiltLibrary’ implementation that I don’t have to implement on my own. Something where I can simply add the StaticLibraryFile, SharedLibraryFile, includes, etc. to and then add that to the collection.

My use case is…

I have numerous external dependencies across many different platforms. *

Some platforms don’t use certain sdks.

Because of this, my root project conditionally specifies zips of the sdks, as external dependencies. Then, I extract them into a known relative path. This is working fine for our current make process, with file names hard-coded all over the place. But, I now want to fully migrate to the ‘cpp’ plugin for each project. But, I don’t see a good way for me to reference all of these prebuilt libraries without placing a huge block of code in each build file.

So, my solution is to traverse the sdks directory and configure all of the variants of the sdk libraries available. Is this feasible? I thought that I heard Daz mention that people were doing this in one of his talks. Also, I want to reuse this logic in different builds, as well. E.g. I’m hoping that I can push this logic into some plugin. Any pointers are greatly appreciated.