Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 789
Zartog Avatar asked Nov 20 '09 22:11

Zartog


People also ask

What compiler does MSBuild use?

By default, MSBuild will attempt to only run the TypeScript compiler when the project's source files have been updated since the last compilation.

How do I build with MSBuild?

To build a specific target of a specific project in a solution. At the command line, type MSBuild.exe <SolutionName>. sln , where <SolutionName> corresponds to the file name of the solution that contains the target that you want to execute.

How do I run MSBuild command?

To run MSBuild at a command prompt, pass a project file to MSBuild.exe, together with the appropriate command-line options. Command-line options let you set properties, execute specific targets, and set other options that control the build process.


2 Answers

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%\CodeGear\RAD Studio\5.0
set MSBuildBinPath=%WinDir%\Microsoft.NET\Framework\v2.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]

like image 82
jasonpenny Avatar answered Oct 20 '22 17:10

jasonpenny


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

msbuild /target:Build
like image 33
Uwe Schuster Avatar answered Oct 20 '22 19:10

Uwe Schuster