15

I'm trying to automate the build of a project in Delphi 2009.

I'm using msbuild with .net 3.5

I simply call:

Z:\Server>C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild "BestSellerAppServer.g
roupproj" /target:Build

And get this:

Build started 27/08/2009 01:15:45 p.m..
Project "Z:\Server\BestSellerAppServer.groupproj" on node 0 (Build target(s)).
Project "Z:\Server\BestSellerAppServer.groupproj" (1) is building "Z:\Server\Be
stSellerAppServer.dproj" (2) on node 0 (default targets).
Z:\Server\BestSellerAppServer.dproj : error MSB4040: There is no target in the
project.
Done Building Project "Z:\Server\BestSellerAppServer.dproj" (default targets) -
- FAILED.

Done Building Project "Z:\Server\BestSellerAppServer.groupproj" (Build target(s
)) -- FAILED.


Build FAILED.

"Z:\Server\BestSellerAppServer.groupproj" (Build target) (1) ->
"Z:\Server\BestSellerAppServer.dproj" (default target) (2) ->
  Z:\Server\BestSellerAppServer.dproj : error MSB4040: There is no target in th
e project.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.06

I compile fine inside the IDE.

I found this http://huwk.blogspot.com/2009/02/msbuild-fails-to-compile-delphi-2009.html but not solve the issue.

2 Answers 2

21

There is a batch file called rsvars.bat (search for it in the RAD Studio folder). Call that before calling MSBuild, and it will setup the necessary environment variables. Make sure the folders are correct in rsvars.bat if you have the compiler in a different location to the default.

1
  • Old post, but maybe still relevant to some. For my build server to succesfully run msbuild with Delphi XE2 projects, I hed to extend rsvars.bat with: SET BDSBIN=C:\RADStudio\XE2\bin SET BDSLIB=C:\RADStudio\XE2\lib Dec 18, 2018 at 11:52
10

Have you set an environment variable named "BDS", equal to your RAD Studio folder?

1
  • 1
    Yes. This is the exact thing that needs to be done. Thank you!
    – Scott Saad
    Nov 3, 2011 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.