On 4 March 2011 16:13, Peter Niederwieser <[email protected]> wrote:

>
> Leo Mekenkamp wrote:
> >
> > Gradle has support for projects and sub-projects, but does that support
> go
> > more levels deep? Can you create a project that contains sub-projects
> that
> > contain sub-sub-projects?
> >
>
> Yes. One thing to note is that Gradle currently only supports one
> settings.gradle per multi-project. This means that the "sub-sub" projects
> have to be declared in the root project's settings.gradle.
>

Ah, that is something I did not get from the user manual.

In Gradle terminology, the set of direct descendants of a project is called
> "child projects", and the set of all descendants is called "subprojects".


 Handy.

 Leo Mekenkamp wrote:
> >
> > I am inclined to think the answer is 'no', because in such a structure I
> > run
> > into problems: the sub-sub-projects use the java plugin (the sub-projects
> > and the (top) project do not) and the top project has "defaultTasks
> > 'build'"
> > in its build.gradle, but I get a
> > "org.gradle.execution.TaskSelectionException: Task 'build' not found in
> > root
> > project (...)" when trying to build the top project.
> >
>
> My guess is that you didn't add the "sub-sub" projects to the root
> projects'
> settings.gradle.
>

Correct. settings.gradle in the top project now has "include 'sub',
'sub:subsub'" and it works like a charm.

cheers,
--L

Reply via email to