Is it possible to run two independent gradle tasks from same subproject in parallel?

后端 未结 1 1144
野趣味
野趣味 2021-01-20 10:33

In project on which I work (based on gradle) there is one very big module (gradle subproject). During build on CI two tasks from this subproject are executed sequentially an

相关标签:
1条回答
  • 2021-01-20 10:57

    From the documentation (see Parallel execution):

    Most builds consist of more than one project and some of those projects are usually independent of one another. Yet Gradle will only run one task at a time by default, regardless of the project structure (this will be improved soon). By using the --parallel switch, you can force Gradle to execute tasks in parallel as long as those tasks are in different projects.

    I think the most important part here is "as long as those tasks are in different projects": if your two long-running tasks belong to the same subproject you won't be able to make them executed in parallel (not in current Gradle version)

    0 讨论(0)
提交回复
热议问题