Ability to swap root of multibuild

I have a multiproject :b rooted in directory B that I want to be able to build both on its own with settings in B.

I also want to be able to build the project in B as :a:b as part of larger multiproject :a in A by specifying settings on the command line.

I think I could have done this if only there was a way to add the root level :a:b in the former using settings in B, but it doesnā€™t seem to be possible to set another rootDir without moving settings to it, and then the first build would not work without specifying its settings too.

Any ideas?

Aggregating builds isnā€™t currently supported. Iā€™d probably create another ā€˜settings.gradleā€™ which is a superset of the former, and live with the duplication, at least for now.

Agreed, the ā€œdefaultā€ ā€˜settings.gradleā€™ under B would be a subset of the other ā€œbigā€ ā€˜settings.gradleā€™.

In order for the project in B to fit in both the ā€œdefaultā€ and the ā€œbigā€ builds, its path should be ā€˜:a:bā€™ in both cases, and for this to happen with the ā€œdefaultā€ ā€˜settings.gradleā€™ in B, it must be able to set the root directory to something other than B.

Is that possible?

Are you talking about the logical of physical project hierarchy? When build B is used on its own, its root project will always have logical project path ā€˜":"ā€™ (not ā€˜":b"ā€™). When B is a part of A, Bā€™s root project will have logical project path ā€˜":b"ā€™ (not ā€˜":a:b"ā€™).