Navigation:  Actions > Borland/CodeGear >

Make Delphi / C++Builder / RAD Studio Action

Previous pageReturn to chapter overviewNext page

The Make Delphi / C++Builder / RAD Studio custom actions create a step to build Borland/CodeGear Delphi, C++Builder, RAD Studio, C#Builder, and Turbo projects and groups.

 

This action processes individual project or multi-project group files.  When building .dpr and .bpg files, it invokes the command-line compiler (dcc32.exe) for each project; for .bdsproj, .bdsgroup files (Delphi 8, 2005, and 2006), it invokes the Delphi/BDS command-line compiler (bds.exe) for the project or group specified, and for .dproj .cbproj, and .groupproj (Delphi 2007 and later) files, it invokes MSBuild (msbuild.exe) for the project or group specified.  All build output from the compiler is logged.  If any errors occur while building, the error output is logged and the action fails.

 

This action has been tested with Delphi, C++Builder, Turbo, Borland Developer Studio, and CodeGear RAD Studio product versions 5, 6, 7, 8, 2005, 2006, and 2007 and may also work with other versions.  See the Borland.bld and CodeGear.bld samples for projects utilizing this action.

 

Project/Group Tab

 

Versions Tab

 

Properties Tab

 

Options Tab

 

 

Version/Property Handling

For each project that is processed, if any values are specified on the Versions or Properties tabs, the following logic is performed before building the project:

 

Project files:

Versions/properties are added/updated in the project file.

 

Win32 Delphi projects:

If the Update DOF checkbox is checked, the .dof file is updated with any settings from the step, the Include Version Info setting is enabled, and the Auto-Increment flag is updated to match the step settings (enabled if the step is set to increment versions).  This step applies only for Delphi 7 and earlier.
If the project file does not contain a directive to include its .res file ({$R *.res} or {$R ProjectFile.res}), the reference is added.

 

Projects that reference or contain a ProjectFile.res file:

A custom RC file named <ProjectFile>.vrc in the project directory with a VERSIONINFO resource is created/updated if it differs from the values specified in the step.
If the associated <ProjectFile>.vres file doesn't exist or is older than the .vrc file, <ProjectFile>.vrc is compiled to <ProjectFile>.vres with the Borland resource compiler (BRCC32.exe).
If ProjectFile.res does not exist, does not contain a VERSIONINFO resource, or the VERSIONINFO resource information is not up-to-date, the file is created/updated with the VERSIONINFO resource from <ProjectFile>.vres.

 

.NET projects:

Versions/properties are added/updated in the project's AssemblyInfo file and/or .dpr/.dpk file.

 

These steps ensure that the compiled executable contains the version information specified by the user, since the Delphi command-line compiler ignores any version property settings made in the IDE, and will also result in subsequent builds in the IDE matching the version/property settings configured in the Make Delphi step.

 

 

Troubleshooting

File not found errors (i.e.: Sample.dpr(8) Fatal: File not found: 'abc.dcu', and other errors relating to missing files) can occur when building a Delphi project or group even though the same projects compile correctly within the IDE.  This is not due to issues with Visual Build Pro, but rather with the Borland Delphi command-line compiler behavior.  When building projects from the IDE, the directories defined in Environment Options are used.  However when the command-line compiler (dcc32.exe) is invoked, these directory definitions are not used, and must be defined elsewhere.  See the following entries in the Delphi Help file for additional information:  Dcc32.exe, Dcc32.cfg, Compiler Directives, Directory Options.