Performing multiple exec tasks in parallel

I perform several tasks execduring the build process. Each run takes about one minute to complete, so I would like to run them in parallel to improve the overall build performance.

A goal that performs several tasks exec:

<Target Name="CreatePackages" DependsOnTargets="Build" AfterTargets="Build">
  <Exec Command="SomeExecutable.exe %(SomeGroup.Location) </Exec>
</Target>

Definition ItemGroup:

<ItemGroup>
  <SomeGroup Include="Production">
    <Location>SomePath/Production</Location>
  </SomeGroup>
  <SomeGroup Include="Test">
    <Location>SomePath/Test</Location>
  </SomeGroup>
  <SomeGroup Include="Development">
    <Location>SomePath/Development</Location>
  </SomeGroup>
</ItemGroup>

How to run these exectasks in parallel?

+2
source share
1 answer

MSBuild , . , (), TPL (System.Threading.Tasks.Parallel) Microsoft.Build.Tasks.Exec System.Diagnostics.Process (), YieldDuringToolExecution ( , ).

+1

All Articles