Delphi Projects are not getting built in parallel with MSBUILD
Mohammad Mohsin
1
Reputation point
I am trying to build Delphi independent projects in parallel by using the BuildInParallel parameter with /m switch but the projects are getting built sequentially.
While calling Delphi projects from proj file I was getting the error MSB4057: The target "Build" does not exist in the project and that gets resolved by using a batch file that will combine the lines of rsvars.bat and msbuild.exe.
The content of proj and batch file looks like this;
PROJ file content
<Target Name="TargetTest">
<ItemGroup>
<TargetProjectsToBuild Include="$(ProjectDir)\Server\Common\lib.dproj"/>
<TargetProjectsToBuild Include="$(ProjectDir)\Server\XXXX server\Test1.dproj"/>
<TargetProjectsToBuild Include="$(ProjectDir)\Server\XXXX server\Test2.dproj"/>
<TargetProjectsToBuild Include="$(ProjectDir)\Server\XXXX server\Test3.dproj"/>
<TargetProjectsToBuild Include="$(ProjectDir)\Server\XXXX server\Test4.dproj"/>
<TargetProjectsToBuild Include="$(ProjectDir)\Server\XXXX server\Test5.dproj"/>
</ItemGroup>
<Exec Command=""$(BatFilePath)\BuildDelphi.bat" "%(TargetProjectsToBuild.Identity)" Release Win64 $(OutDir) Build $(SigningDelphiCert)" ContinueOnError="true"/>
</Target>
Batch file content
call "C:\Program Files (x86)\Embarcadero\Studio\20.0\bin\rsvars.bat"
MSBuild.exe %1 /p:BuildInParallel=true;Config=%2;Platform=%3;Outputfolder=%4;Certificate=%6 /t:%5 /m:2
There are 2 cores available on the agent