Custom Build Actions
The Custom Build Actions dialog appears when you click the Custom Build Actions... on the Build page. It allows you to specify external actions that are performed before and after each project build.
External build actions
External build actions are specified as command lines, much as you would enter commands in a command prompt window. At build time, Tarma QuickInstall writes the build action commands to a temporary batch file, starts a command processor to execute the batch file, waits until the command processor has finished executing the batch file, then resumes the build process.
Some hints and tips:
- The external build actions are not performed during preflight checks.
Pre-build actions are performed after the preflight checks are successfully
completed, immediately before the project build proper starts. Post-build actions
are performed after the build process is completed, regardless of the success
or failure of the build.
- The pre-build and post-build commands are written to separate batch files,
with file names based on the build target and ~Pre.bat or ~Post.bat suffixes.
The batch files are written to the build folder (i.e., the same folder that
holds the output and log files of the build process), and are retained until
the next project build. You can use this feature for diagnostic purposes (the
contents of each batch file are also copied to the build log).
- The batch files are executed with the current directory set to the build
folder, so any file names that you specify should either be fully qualified,
or relative to the build folder.
- Tarma QuickInstall uses the COMSPEC environment variable to determine
which command processor to use. Therefore, if you have installed an alternate
command processor such as JP Software's 4DOS or 4NT, you can take advantage
of their extended command syntax in the pre- and post-build actions if the COMSPEC environment
variable is set to point to the alternate command processor.
- Command line redirection works as expected. In particular, you can use > and >> to
capture output from your commands, if desired.
- You can use project variables as part of the command lines. However, project
variables that contain system information lookup (using the syntax <@...>, <%...>,
or <#...>; see Project variables for
details) directly or indirectly, resolve to empty strings because Tarma QuickInstall
does not perform system information lookup during the build process.
- Be sure to quote any file names that include spaces. This also applies to
build-time project variables such as <BuildTarget>, which might
expand to include spaces. If necessary, inspect the build log or the batch
files that Tarma QuickInstall generates if you encounter any problems in this
respect.
- During the build process, Tarma QuickInstall opens the build log file with
read-only sharing. Therefore, your custom actions cannot write to the build
log file and can only read it if they open it with read-only access. Attempts
to open the log file with both read and write access (even if only to read
it) will fail.
Fields
Pre-build actions
Enter the actions that you want performed before each project build. You should enter them as command lines, similar to the command lines that you would use in a command prompt window.
Post-build actions
Enter the actions that you want performed after each project build. You should enter them as command lines, similar to the command lines that you would use in a command prompt window.
OK
Click this button to confirm the actions and return to the Build page.
Cancel
Click this button to cancel the dialog; any changes that you made to the actions will be discarded.