Where do place tasks to assemble a multiproject build?

We have a multiproject build and we have what we call components, which is a shippable piece of software. For example component X depends on the output of project A, B and C and component Y depends on the output of A, B and D and so forth (we have about 15 components). Where would you usually put the tasks to assemble or bundle these components?

Either in the project for that component, or in the root project.

To place it in the root project was our initial thought, too? However, that seems to pollute the root’s project buildscript. Is there a way in gradle split up a build script in several files ?

See “Configuring the project using an external build script” in the Gradle User Guide.

That works perfectly for us - thanks.