Delphi Projects are not getting built in parallel with MSBUILD

Mohammad Mohsin 1 Reputation point
2022-05-12T08:21:14.707+00:00

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="&quot;$(BatFilePath)\BuildDelphi.bat&quot; &quot;%(TargetProjectsToBuild.Identity)&quot; 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

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,995 questions
{count} votes