Running From the Command Line (BuildConsole)

Running From the Command Line

Overview

The /command switch enables the Make and Build Tools capability of the BuildConsole command line interface. This capability highly accelerates the build time of various build tools applications, by distributing build tasks that are to be executed in parallel on remote machines across the network utilizing their idle CPUs. All that is required to accelerate your build time, is to execute your original build command using 'BuildConsole /command'.

Usage

The following syntax is used to operate 'BuildConsole /command':

BuildConsole /command="<your original build command line>" [Options]


Where:

/Command is designed to execute command lines of various build tools (e.g. Make, Ant, etc), in a distributed manner, without the need to configure IncrediBuild in any way.

Note:

For example:

BuildConsole /command="make --file=makefile.mak -B"

By default, IncrediBuild automatically adds a parallel processes switch (in Make, this switch is called -j; in msbuild it is /m:). In Make, it changes the value of an existing -j switch to a larger value, if the command is given as in the example above. However, if the command is given in a Batch file, i.e. /command = Batchfile, and the Make command that runs the build is inside the Batch file, IncrediBuild cannot know how to change the -j value, and therefore does not change it.

The following is a list of switches that IncrediBuild changes:

By default, IncrediBuild changes the -j switch value to 200. However, you can keep the original number in the –j switch and tell IncrediBuild not to replace it, by adding the following switch to the BuildConsole command line: /keeporigjobsnum=true

Notes:

Command Line Options:

Option Function Notes
/Command This switch enables the Make and Build Tools capability of the BuildConsole and allows execution of command lines of various build tools (e.g. Make, Ant, etc), in a distributed manner without the need to configure IncrediBuild in any way. The build tools themselves must be installed on the initiating machine.
/UseMSBuild Forces the usage of MSBuild By default, IncrediBuild uses Devenv to perform the build. Using this switch, IncrediBuild will use MSBuild which will enable the option to add specific MSBuild flag using the /msbuildargs as can be seen below.
/msbuildargs="/myarg1 /myarg2" Passes additional arguments to MSBuild when using the buildconsole command's '/usemsbuild' switch.

For example:

BuildConsole dcom.sln /rebuild /cfg="debug|win32" /msbuildargs="/detailedsummary" /usemsbuild

@ Specifies a response file containing a 'BuildConsole /command' command line. Use this option when the command line for running 'BuildConsole /command' is too long to specify explicitly in your script.
/SETENV="<name>=<value>" Sets or overrides environment variables for the context of the run build. Use /SetEnv several times to set/override multiple variables.
/Log[=filename] Writes build output to a file. If filename is omitted, a file named IB_<target-name>.log is created in the current directory.
/Mon[=filename] Writes a copy of the build progress (.ib_mon) file to the specified location. If only a folder name is given, IncrediBuild generates a GUID for the file name.
A message containing the location of the saved .ib_mon file is added to the end of the build output.
/out=filename Redirects entire command line output to a file.
/Silent Does not write anything to the standard output. Default behavior is to write the build results, as seen in the Build Monitor's Output display.
/Attach Displays the build output of either the current or last build. If a build is currently running on the machine, this displays the output for the build up to that point, and continues displaying the build's output until it ends. If no build is running, ,'BuildConsole /command' displays the entire build output for the last build initiated from this machine.
/Wait If another build initiated by this Agent is currently running, waits until that build is finished and then starts the new build. This is also the default behavior.
/NoWait When specified, if another build initiated by this Agent is already running 'BuildConsole /command', it exits with a "Another build already running" message.
/NoLogo Suppresses the "IncrediBuild" header in the build output.
/Beep Plays a sound when the build is complete.
/Stop Stops a currently running build on the local machine. 'BuildConsole /command' returns the code 3 when a build has been stopped. If /stop was used and no build is currently running, code 2 is returned.
/Enable Enables the IncrediBuild Agent.
/Disable Disables the IncrediBuild Agent.
/Reset Clears the Agent's file cache contents.
/Title=<build title> Specifies a custom header line to be displayed in the beginning of the build output text. This title is also used for the Build History and Build Monitor displays. Value may be surrounded by quotes.
/QueryLicense Displays information regarding the active license, allocated packages, and maintenance expiration date.
/QueryPackage="<Package>" Checks whether a specific IncrediBuild extension package is allocated to the Agent, and sets exit code to 0 (allocated) or 1 (not allocated). "<Package>" can be either "VC", "C#", "BuildTools", "DevToolAcc", "XGE", "Xbox One", "PlayStation", "Cafe", "3DS", "KlocWorkPro" o "Coverity". In addition, the following cores packages are supported: "4Cores", "8Cores", "12Cores", "16Cores", "24Cores", "32Cores", "48Cores" and "64Cores".
/ShowCmd Shows, for each file built, the command-line used by IncrediBuild to build the file.
/ShowAgent Shows the Agent used to build each file.
/ShowTime Shows the Start and Finish time for each file built.
/OpenMonitor Opens the Build Monitor window showing the build progress.
/MaxCPUS=<n> Overrides global maximum CPUs/Cores in build setting.
/AvoidLocal=[On/Off] Overrides the Agent Settings dialog Avoid task execution on local machine when possible option. A value (either ON or OFF) is mandatory.
/MaxWinVer="<Version>" Specifies the maximal operating system required by remote Agents assigned to this build. Agents with a newer OS will not be assigned to the build. Available values are: XP, 2003, VISTA, 2008, 7, 8 and 10.
/MinWinVer="<Version>" Specifies the minimal required operating system required by remote Agents assigned to this build. Agents with an older OS will not be assigned to the build. Available values are: XP, 2003, VISTA, 2008, 7, 8 and 10.
/StopOnErrors When specified, the build stops as soon as an error is encountered.
/KeepOrigJobsNum=[True/False] Setting this option to true, forces IncrediBuild to use the original value for the -j switch. By default, IncrediBuild changes the value of the -j switch to 200 if the original value is higher than 200. Setting this option to True, allows for higher values of -j.
/LogLevel="<Level>" Overrides the logging level for this build. "<Level>" can be one of the following: Minimal, Basic, Intermediate, Extended, Detailed
/Help Shows usage help and version information.
/NO_DOTNET_VIRT Disables the Virtualization of .NET environment on Helper machines. When this switch is specified in the command line it instructs IncrediBuild not to virtualize the .NET environment of the Initiator machine to the Helper machines. This switch was added to address .NET incompatibilities in a mixed OS environment.

Return Codes

BuildConsole returns the following return codes:

0 - No errors were encountered.
1 - Errors were encountered during the operation.
2 - A fatal IncrediBuild error was encountered (invalid parameters, input file not found, etc.).
3 - The operation was stopped before completing.

Additional Notes