Build Events

From RAD Studio
Jump to: navigation, search

Go Up to Building


Project > Options > Building > Build Events

Use the Build Events dialog box to add events for the pre-build, pre-link and post-build stages. Results of the commands you specify in this dialog box are displayed in the Output pane. To control the level of output, choose Tools > Options > IDE > Compiling and Running and adjust the Verbosity level.

Note: Some of the build options are not available for some project types. For example, Pre-link events are available only for C++ projects.


Options Description

Target, Apply, Save

See Target Options.

Post-build events

  • Cancel on error
    Cancels the project build if a command returns a nonzero error code.
  • Commands
    Enter the commands that are to be performed after the build has successfully completed.
    To display the Build Event Commands dialog box for creating the command list, click the ellipsis [...] that pops up in the Commands field.
  • Execute when
    Executes the specified events either Always or only if the Target is out of date. This option is available only for Post-build events.

Pre-build events

  • Cancel on error
    Cancels the project build if a command returns a nonzero error code.
  • Commands
    Enter the commands that are to be performed before the build starts.
    To display the Build Event Commands dialog box for creating a command list, click the ellipsis [...] that pops up in the Commands field.

Pre-link events

Pre-link events are available for C++ only.

  • Cancel on error
    Cancels the project build if a command returns a nonzero error code.
  • Commands
    Enter the commands that are to be performed after the compile phase but before linking.
    To display the Build Event Commands dialog box for creating a command list, click the ellipsis [...] that pops up in the Commands field.

Warning for Build Events

Build events can execute arbitrary commands on your system. It is common to get projects, which include build events, from third parties online. Running build events from untrusted sources can be a potential security risk to your system.

RAD Studio warns you when a project contains a build event in any configuration (including the one you are not currently building.)

WarningForBuildEvents.png

Click Yes to continue building, including running any build events. Check Always trust this project to trust this project in the future. This means that build events for this project will always be executed without displaying this warning again.

Trusted projects are stored by path in the registry. If you move the project, the IDE will prompt again.

Projects are not stored by version, hash, or other data. It is possible to mark a project as trusted, get a newer modified version (e.g. by pulling from remote source control), and not get warned even if a project has a build event it did not before. Therefore, this is a security mitigation intended to assist you but must not be taken as preventative in all situations.

See Also