English 中文(简体)
How can I get MSBuild to do a full build of a Delphi project equivalent to dcc32 -b?
原标题:

How can I get MSBuild to do a full build of a Delphi project equivalent to dcc32 -b?

I ve got two projects I m trying to build, the first one uses some conditional defines, which are getting passed via msbuild to the dcc32. However, some common units appear to be stuck with the first set of conditionals, so the second project is built improperly.

最佳回答

I believe it s /t:rebuild, the msbuild output lists "Deleting file: ..." for all the dcu s, then builds the project.

I use a batch file to call msbuild to build delphi projects, for Delphi 2007 and Delphi 2009 (which just has a different path for %BDS%):

set DCC_Quiet=true
set BDS=%ProgramFiles%CodeGearRAD Studio5.0
set MSBuildBinPath=%WinDir%Microsoft.NETFrameworkv2.0.50727

call %MSBuildBinPath%msbuild /nologo /t:rebuild /p:config=Release %1 %2 %3 %4 %5

[Note, from this question, for Release "Build Configuration", Delphi 2009 is /p:config=Release, and Delphi 2007 is /p:Configuration=Release]

问题回答

I guess the question Delphi MSBuild Build Configuraions From Command Line contains the answer. Try

msbuild /target:Build

As I remember in D7 there was a similar problem when GUI vs dcc32 produced different builds. Take a look at location and content of your dcc32.cfg file(s). They actually can contain as many conditionals as you need. One conditional per-line

Another option is to delete the DCU s of the compiled units after your first build is complete and before you start your next one.

With my RAD Studio 2010 Professional, /t:rebuild is not defined. I figured

MSBuild.exe /t:Build /p:config=Release;DCC_BuildAllUnits=true

does the job





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签