Parallel: ensure project dependencies are built before


I have a setup where one project depends on the build of other projects.


Other project

In “projectC” I have dependencies on A and B like so


This works fine but when I enable org.gradle.parallel=true not all tasks in project A and B have completed before project C runs its tasks.

Is there some way to force this? Or to preserve ordering?


This is the expected behavior. Tasks should be small discrete units of work. Only tasks in C that have an explicit or implicit dependency on a task/output in A or B would necessarily run after that task in A/B, and only that specific task, not all tasks in the project. You can add dependencies (dependsOn) task ordering requirements/hints (mustRunAfter/shouldRunAfter), but this almost always a bad practice if there’s not an actual dependency.