My problem is that I have multiple subprojects that I want to be built in parallel, however each project has multiple tasks that cannot be run in parallel.
For Example:
ProjectA has a compileWindows and compileLinux task. These cannot be run in parallel.
ProjectB has a compileWindows and compileLinux task. These cannot be run in parallel.
I want ProjectA to be able to be built in parallel to ProjectB - so :ProjectA:compileWindows
should be allowed to run in parallel to :ProjectB:compileWindows
- but :ProjectA:compileWindows
should not be able to run in parallel to :ProjectA:compileLinux
The best way I can think of to do this right now, based on reading the Task API documentation is to use Task.mustRunAfter(...)
for the compile
tasks within each project.
- Will using
mustRunAfter(...)
like this force both tasks to run? There are occasions where I may wantcompileWindows
to run but notcompileLinux
and vice versa. - Is there any other way I can get this behavior of preventing certain tasks from running in parallel? I find the
mustRunAfter(...)
approach odd because technically these tasks within the project do not need to be ordered in any way, they simply cannot run alongside one another.