I finally decided to create a simple plugin to allow execution of gradle tasks concurrently within the same module. If its any help, the project is located on github. The main use case driving the creation of this plugin was to allow me to execute multiple app servers (each defined by its own gradle task) to assist with development. I’m not comfortable with the idea of using it for production, but would be interested in discussing it. I might submit it back to gradle if anyone thinks its useful.
There is actually support for running multiple tasks in the same project in parallel but it’s not currently publicly documented. You can enable the feature by setting a system property -Dorg.gradle.parallel.intra=true. This is still incubating and it can be very easy to do naughty things in your task implementations which is why it isn’t yet public. Take a look at the JavaDoc for @ParallelizableTask for more information.
Those of us coming from a GNU Makefile background should be very much aware that shared data should not be modified. For example, when GNU Make targets are executed in parallel, we already know we cannot write to a fixed-name temporary file, we explicitly use mktemp to avoid those collisions.
Will I be able to run tasks of Exec type in parallel, so I can call my external compilers?