level parallelism from gradle's project
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?
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 (eg using the GPars library).
上一篇: 限制任务并行库中的线程数
下一篇: Gradle项目的高层并行性