Parallel: ensure project dependencies are built before

Hi,

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

Dependencies:
/projectA/build.gradle.kts
/projectB/build.gradle.kts

Other project
/projectC/build.gradle.kts

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

api(project(":projectA"))
api(project(":projectB"))

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?

Regards
Richard

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.