Thanks for your reply. Yes, these are two large projects in different repositories. A has a copy of the compiled artifacts from B, which is fine for most build tasks. But if a developer were working on code in both projects at the same time, he’d want A’s build to automatically run B’s build and pull in the resulting artifacts.
I have some Gradle code written which checks for the existence of B’s top-level directory. If it exists, and A’s taskGraph includes a compileJava task, then we should go build B as soon as A’s task graph is ready, before any tasks in A are executed. Then it copies build artifacts from B to A. There’s also some logic to clean B if A is being cleaned. The only piece I’m missing is the ability to run another Gradle build without defining a task to do so.