RAD Studio (Common)
MSBuild Overview

To build projects, the IDE now uses MSBuild instead of the previous internal build system. The build, compile, and make commands available in the IDE call the new build engine from Microsoft: MSBuild, which provides thorough dependency checking. MSBuild project files are XML-based, and contain sections that describe specific Items, Properties, Tasks, and Targets for the project. 

For more information about MSBuild, see the Microsoft documentation at http://msdn.microsoft.com.

If you open a pre-existing Delphi project (such as one with.bdsproj extension), the IDE automatically converts the project to use MSBuild and changes the project extension to .dproj for a Delphi project or to .cbproj for a C++ project. 

Project groups are also converted to MSBuild and given the project-group extension .groupproj.

You can build projects without knowing anything about MSBuild because the IDE handles all the details for you. The ProjectCompile and ProjectBuild commands both invoke MSBuild, but the scope of each command is different.  

You can also explicitly build projects from the command line by running MSBuild.exe with your .dproj file.  

To invoke MSBuild in a custom command environment, choose Start menuRAD Studio Command Prompt. This command window automatically sets both the path to the executable and the variable for your installation directory.  

If you want to use MSBuild from the command line outside of the RAD Studio Command Prompt, you should set the following environment variables yourself: 

BDS=c:\program files\CodeGear\RAD Studio\5.0 FrameworkDir=c:\Windows\Microsoft.NET\Framework FrameworkVersion=v2.0.50727 

Several pages of the ProjectOptions dialog box allow you to save groups of options into a named build configuration. Two default build configurations are Debug and Release. C++Builder supports a Base configuration as well. You can use the Configuration Manager to selectively apply any named build configuration as the active build configuration for your project or project group.

When you build a project, the results of the build appear in the Messages window, on the Output tab. You can specify pre-build and post-build events using the ProjectOptionsBuild Events dialog box (C++Builder supports pre-link events as well). If you specify build events, the commands you specified and their results also appear in the Messages window. To control the level of output from MSBuild, use the Verbosity field on the ToolsOptionsEnvironment Options page.

MSBuild builds a project using the following order:

  1. .RC files
  2. .ASM files
  3. .PAS files
  4. .CPP files
The build proceeds downward through the directory or folder nodes in the Project Manager. Within each folder, files are built in order according to their file type. You can control build order by placing files within different folders or within virtual folders in the Project Manager.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!