Could someone provide some examples of using a dependencySpec?

I was starting to poke around the new dependency resolution stuff because I think things like:

might be useful. However, I’m not sure how to generate useful dependency specs. I found the ‘Specs’ class which looks relevant, particularly its ‘convertClosureToSpec’ method. But I don’t know what I should be doing in my closure.

Could anyone post some examples or descriptions of what a dependencySpec looks like/does?

Thanks in advance, Chris

The closure accepts an ‘org.gradle.api.artifacts.Dependency’ and should return true or false depending on whether it wants the dependency’s files included in the result or not. Alternatively, you can implement and pass an ‘org.gradle.api.specs.Spec’ that does the same. The latter is mostly interesting for non-Groovy code.

Thank you - that’s what I needed.