Build Events page of Visual Studio project properties
Use the Build Events page of project properties in Visual Studio to specify pre-build and post-build events for a Synergy project.
To access the Build Events page, select a project node in Solution Explorer, select Project > Properties from the Visual Studio menu, and then select the Build Events tab.
Note the following:
- The % character is a reserved character for MSBuild, so to specify it in one of the fields on the Build Events page it must be replaced with the %25 hexadecimal escape sequence. For example, to specify %MY_VAR%, type %25MY_VAR%25.
- To terminate a build when a pre-build or post-build event fails, configure the event action to exit with a non-zero value.
Environment variables set on the Build Events page apply before or after the build, not during the build. To set environment variables for the build, use the Environment Variables page or the Common Properties page. (Settings on the Environment Variables and Common Properties pages are not used for pre-build or post-build events.)
Pre-build event command line
Enter commands you want executed before the build starts. Use commands that are valid at a command prompt or in a .bat file. For example, for a traditional Synergy project, you could add a command that runs a batch file that builds UI Toolkit window scripts:
Note that if you specify a .bat file, the name of the file should be preceded by "call" (without quotes). Otherwise, subsequent commands may not run.
To enter long commands, click "Edit Pre-build".
Run the pre-build event
Specifies conditions under which the pre-build event is run:
|Always||Run pre-build event whenever a build is started for the project.|
|If the compile files have changed||Run pre-build event only if a compile file has changed.|
|If the content files have changed||Run pre-build event only if a content file has changed.|
|If the compile or content files
|Run pre-build event if either a compile file or a content file has changed.|
Post-build event command line
Enter commands you want executed after the build ends. Use commands that are valid at a command prompt or in a .bat file. Note that if you specify a .bat file, the name of the file should be preceded by "call" (without quotes). For example: call C:\MyFile.bat. Otherwise, subsequent commands may not run.
To enter long commands, click "Edit Post-build".
Run the post-build event
Specifies conditions under which the post-build event is run:
|Always||Run post-build event even if the build fails.|
|On successful build||Run post-build event only if the build succeeds.|