Adding a Custom Build Tool

From RAD Studio
Jump to: navigation, search

Go Up to How To Compile and Build Applications


Use the Build Tools dialog box to add custom tools that will be executed during a project build. You can also associate a custom build tool with specific files. This topic describes both of these operations, as well as disassociating a build tool from a file.

For example, you might add a perl tool on the Build Tools dialog box. After you use the Object Inspector to associate the file myfile.pl with the perl custom build tool, the perl tool is executed on myfile.pl whenever you build the project.

Note: You cannot associate a custom build tool with a .pas file (these files are handled only by the Delphi compiler).

To create a custom build tool

  1. Choose Tools > Build Tools.
  2. Click New. A new tool is added to the Tools list, with the name CustomTool<n>.
  3. In the Name field, enter a more specific name for the tool. For example, if you are adding perl as a build tool, you would enter perl in Name.
  4. (Optional) In Description, enter a description of the tool and its purpose.
  5. In Commands, enter the commands that the tool is to execute. For example, perl $(inputfilename) which expands to the full path to the file in the project that you have associated with this custom tool. You can use any of the macros that are displayed in the Macros field.
  6. Click OK.

To associate a custom build tool with a specific file

  1. In the Projects Window, select the file that you want to associate with a custom build tool. For example, for the perl custom build tool, you might select myfile.pl.
  2. In the Object Inspector, locate the Custom Build Tool field:
    CustomBuildToolsInObjInsp.jpg
  3. Click the dropdown arrow for Custom Build Tool and choose the tool that you want to associate with the selected file. For example, for the file myfile.pl, choose the perl custom build tool.

To disassociate a custom build tool from a file

  1. In the Projects Window, select the file that you want to disassociate from a custom build tool.
  2. In the Object Inspector, clear the value field for Custom Build Tool.

See Also