When you run a test build of a project using a plugin, you
can use some special environment variables to run commands before and after
files from your system are copied to the server.
All commands are run in the project directory:
- PRECMD variables are used to run a command on directories and files that
are copied from the developer's machine to the server running the build. The
command runs before the project step. Example: this command could check out
files from a source control system before they are copied.
- POSTCMD variables are used to run a command on directories and files after
a project step has executed. Example: this command could be used to free a
checked-out virtual directory (in a source control system that uses such a
concept, like Rational ClearCase).
Commands are run on directories and files marked in a Reflector plug-in
as Build Forge Project Artifacts. The commands are applied as the directory
tree for the reflector is traversed.
Note: Traversal of the directory tree is breadth-first downward for PRECMD
commands and reversed for POSTCMD commands. Commands for directories and commands
for files are run as appropriate during traversal.
- _PRISM_DIR_PRECMD
- Specifies a command to be run on directories as they are encountered during
tree traversal. The command is run once for every directory that contains
at least one file. If the $1 token is used in the command,
it is replaced the name of the directory the command is running on. Only the
first occurrence of $1 is handled this way.
- _PRISM_FILE_PRECMD
- Specifies a command to be run on files as they are encountered during
tree traversal. The command is run once for every file. If the $1 token
is used in the command, it is replaced the name of the file the command is
running on. Only the first occurrence of $1 is handled this
way.
- _PRISM_DIR_POSTCMD
- Specifies a command to be run on directories as they are encountered during
tree traversal. is run once for every directory that contains at least one
file. The command is run once for every directory in the project that contains
at least one file. If the $1 token is used in the command,
it is replaced the name of the directory the command is running on. Only the
first occurrence of $1 is handled this way.
- _PRISM_FILE_POSTCMD
- Specifies a command to be run on files as they are encountered during
tree traversal. The command is run once for every file. The system replaces
the first $1 in the command with the file name.