Reputation: 8758
I've got a gradle build process that dynamically generates a list of ~200 homogeneous, CPU-intensive processing tasks (all of the same task type). The tasks in this list do not depend on one another, but they have commen ancestors and common descendants in my build.
It doesn't look like gradle has a built-in way to let me process these in parallel. (The only parallel abstraction I see has to do with decoupled projects).
Are there any techniques I could apply on top, or am I stuck?
For example, could I dynamically create n
projects (somehow "decoupled" from the main project to satisfy Gradle's parallel processing requirements), each with 1/n
of the tasks I need?
Upvotes: 1
Views: 614
Reputation: 123960
Tasks belonging to the same project cannot currently be executed in parallel. You could script settings.gradle
to create many subprojects and script build.gradle
to assign tasks to projects, but that might not be a very convenient solution. Another option is to have a single task that internally parallelizes the work (e.g. using the GPars library).
Upvotes: 1