How to compile a Delphi project team using MSBuild called from an Embarcadero Makefile

I am trying to compile two components from Virtual Treeview (VirtualTreesR.bpl and VirtualTreesD.bpl) that I have combined in a Delphi project group called VirtualTrees.groupproj. They must be compiled using MSBuild, but this call is made from a Makefile (Embarcadero) file. The relevant part in the Makefile looks like this:

msbuild.exe /nologo /v:m /t:build /p:Config=Release "$(VTVDIR)\Packages\Delphi 2010\VirtualTrees.groupproj" 

Unfortunately, this leads to MSB4040 because the BDS environment variable is not set in cmd.exe, but it is in the Makefile. I tried SET BDS = $ (BDS) before calling msbuild, but to no avail. I also tried setting BDS as a property (/ p: BDS = ($ BDS); Config = Release) that caused another error (something similar: could not find the compiler in% BDS% \ bin \ dcc32.exe).

This call from the Makefile is part of the preparation for creating our product on the CI server, and I cannot guarantee that the BDS variable is set there. So, how can I provide the BDS variable that I have in the Makefile for msbuild that it accepts?

+4
source share
1 answer

In my batch files, I use rsvars.bat:

 call "C:\Program Files (x86)\CodeGear\RAD Studio\5.0\bin\rsvars.bat" MSBuild SomeProject.dproj ... 

(You will need to, of course, configure the path.)

+6
source

Source: https://habr.com/ru/post/1347692/


All Articles