Method One

Method One

This method can be used in Visual Studio 2005 and higher, and allows the distribution of the whole build steps to remote machines:

The IncrediBuild_AllowRemote Directive

In order to indicate that a custom build step or build event is distributable, enter the following line anywhere within the step's command line sequence:

rem IncrediBuild_AllowRemote

This indicates that IncrediBuild may distribute the step's execution to a remote machine.

Examples of custom steps that you may want to execute in a remote machine are:

·         Code generation

·         Rendering

·         Simulations

·         Calculations that are part of the code building

The option of running tasks in remote often goes hand-in-hand with the IncrediBuild_AllowOverlap directive that enables the parallelization of tasks.

If the distributed task creates output files, it is important that these files be specified explicitly using either the custom build step's "Output Files" field (custom build steps only), or one or more of the Output File Definition Directives .

Important! For Visual Studio 2008 and earlier, distributed steps that are missing output file specifications will not create any output files! For Visual Studio 2010 and later, it is recommended to specify the output files. However, they will synchronize even if they are not specified.

The IncrediBuild_AllowOverlap Directive

The IncrediBuild_AllowOverlap directive instructs IncrediBuild to execute custom steps, events and tools in parallel to other tasks that would otherwise be waiting for the end of the execution of the custom steps events or tools, before they would execute.

Consider the following scenario:

Project A is a static library project with a post-link step that deletes some files and writes text to a log file. Project A is defined as a dependency (sub-project) of project B, because project B links with its output. Visual Studio (and thus IncrediBuild's) default behavior is to wait for the completion of all project-level steps in a project's sub-projects before starting that project's compilation. As a result, project B does not start to compile until project A's post-link step has completed, slowing down the build.

In some cases, when a step generates files that are necessary for the next project to compile, this behavior is required. The IncrediBuild_AllowOverlap directive should be used when this is not the case, and output files generated by a project-level step are not referenced by source files in any dependent project.

To declare that the output files of a project-level custom build step or build event (post-build, pre-link, etc.) are not referenced by source files in any dependant project, enter the following line as one of the step's commands:

rem IncrediBuild_AllowOverlap

This will not affect the step's operation, but will advise IncrediBuild to start compiling dependent projects as soon as possible, regardless of that step.

In many cases this directive could also be used to speed up the execution of a single project, since Visual Studio runs tasks within a project in a sequential manner when it comes to custom build steps, build events, build tools and build rules, and in many cases this is redundant.

Note: Custom Build Tools and custom build rules can be distributed and parallelized using IncrediBuild_AllowRemote and IncrediBuild_AllowOverlap in Visual Studio 2005 and 2008, however if you would like to distribute and parallelize Custom Build tools in Visual Studio versions 2010 and higher, please see method two.