views:

88

answers:

1

In Gradle you need to define subprojects to be built in a 'settings.gradle' file. To build three child projects, you would do something like this:

include "child1", "child2", "child3"

The problem I'm having is that I have quite a few projects to include. Is there a way to use a wildcard in this definition? I'm looking for something like this:

include "*"

That of course does not work. This would be a lot easier to work with since I have many subprojects to include. Is there a way to automatically include subdirectories as projects?

A: 

Can you do something like:

include (1..10).collect { "Child$it" }

To include "Child1" up to "Child10"?

Obviously, you'd need to change the collect to some sort of folder scan, but it that quick test works then the scan has a good chance

tim_yates
"child1" and "child2" were just for the example. The real names of the projects do not have numbers in them. I was hoping there was a built in feature for this without resorting to listing the files in the directory, but I guess maybe there is not.
Chris Dail
Doesinclude new File( '.' ).listFiles().findAll { it.isDirectory() } .collect { it.name }work?
tim_yates