defining subprojects in a deeply nested directory tree

gradle

Solution

By default, Gradle assumes that the physical directory layout follows the logical project hierarchy, but you can reconfigure it any way you like. For example:

include "A", "B"

project(":A").projectDir = file("lala/A")
project(":B").projectDir = file("lala/B")

Problem

how do I define sub projects in a nested directory tree where the sub-project folders are not immediate children of the root project ``` root lala A lulu B ``` Now I Want to add A & B as sub projects. If I do ``` //settings.gradle include "lala:A", "lulu:B" ``` then also "lala" and "lulu" will be added as sub projects. However I only want to add A & B and nothing else.

Original source