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"’).