Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image Added

Section


Column

BuildConsole Command Line Interface

Table of Content Zone
locationtop

Overview

BuildConsole.exe, located in the IncrediBuild installation folder, is a console application that allows running distributed Visual Studio builds from the command line, scripts, and applications, or continuous integration management tools such as TFS.

BuildConsole can also be used to accelerate other build tools such as Make, using the /command directive. Further information can be found in the IncrediBuild for Make & Build Tools section.


You can run a distributed job that uses one of the interfaces from the IncrediBuild Interfaces extension package, using the IBConsole.exe command line interface. This interface is used to accelerate your custom tool, such as rendering, simulations, unit testing, QA, scripts, and more.

Highlights

  • Significant decrease in Visual Studio build time
  • Does not require any code, project, or environmental changes
  • Friendly and easy-to-use graphical interface for Visual Studio, with a simple visual build process representation
  • Does not require any installations or VM on remote machines (with the exception of the IncrediBuild agent)
  • Can be further customized to accelerate other tools that are part of the build process

Usage

The following syntax is used to operate BuildConsole.exe:

BuildConsole <Target> [Options]

Where <Target> can be any of the following:

  • A path to a Visual Studio .NET/2005/2008/2010/2012/2013/2015 solution (.sln file)
  • A path to a Visual Studio .NET/2005/2008/2010/2012/2013/2015 project (.vcproj/.icproj/.vcxproj file)
  • A path to a Visual Studio 6.0 workspace (.dsw file)
  • A path to a Visual Studio 6.0 project (.dsp file)
  • A path to an eVC 4.0 workspace (.vcw file)
  • A path to an eVC 4.0 project (.vcp file)

The BuildConsole command doesn’t force you to include the .sln file as part of the build command in order to build specific projects. However, omitting the .sln parameter is not recommended. Some of the information IncrediBuild may require in order to correctly compile the project may be missing from the project file. A known issue, for instance, is when a user would like to determine the Visual Studio version with which to build his project (this information is not part of the project file). For this specific purpose a flag "/VsVersion" was added to IncrediBuild's BuildConsole command that allows specifying the Visual Studio version with which IncrediBuild will build the projects.

The following are examples for running BuildConsole:

  • To rebuild the "Debug|Win32" solution configuration in the solution "MySln.sln":

           BuildConsole.exe MySln.sln /rebuild /cfg="Debug|Win32"

  • To build only the project "Proj1" in the solution "MySln.sln", in both "Debug|Win32" and "Release|Win32" solution configurations:

           BuildConsole.exe MySln.sln /build /prj=Proj1 /cfg="Debug|Win32,Release|Win32"

  • To build a more complex combination of projects and configurations, using a preset called "MyPreset" previously saved in the Batch Build dialog:

          BuildConsole.exe MySln.sln /build /preset="MyPreset"

In addition to this syntax, BuildConsole also supports msdev.exe and devenv.exe command line syntax for building projects. If you are already using batch files that spawn either msdev.exe or devenv.exe, replace the standard MSVC build with an IncrediBuild distributed build, by editing your files and replacing these program names with "BuildConsole.exe".

Note: If when running BuildConsole, you get the error: "'BuildConsole is not recognized as an internal or external command, operable program or batch file.", manually add the IncrediBuild installation folder to your system path or rerun the IncrediBuild setup application on your machine, making sure that the "Add IncrediBuild folder to the system path" option is selected.

Command Line Options

The following command line flags can be used with BuildConsole:

OptionFunctionNotes
@Specifies a response file containing a BuildConsole command line.Use this option when the command line for running BuildConsole is too long to specify explicitly in your script.
/AllCauses a solution/workspace build to continue, regardless of specific projects failing to build.By default, IncrediBuild stops the build when a project fails to build its output file. This option instructs IncrediBuild to continue building the remaining project configurations, regardless of previous projects failing to build.
/AttachDisplays the build output of either the current or the 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 displays the entire build output for the last build initiated from this machine.
/AvoidLocal=[On/Off]Overrides the Avoid task execution on local machine when possible option in the Agent Settings dialog box.A value (either ON or OFF) is mandatory.
/BeepPlays a sound when the build is complete.
/BrowseInfo=[ON/OFF]Forces or suppresses creation of browse information, regardless of current browse information settings.See the Agent Settings section for more information regarding browse information settings.
/CEconfig="<configuration name>" Specifies theWCE platform for eMbedded Visual C++ 4.0 builds.For VS 2008 and prior.
/Cfg=<configuration>Determines the solution configuration to be built. (With VC6 builds, this option specifies the project configuration.)- The value should be enclosed in quotes.
- Several comma-separated configuration names can be specified.
- When building an MSVC 6.0 project, both the following formats are valid:
/cfg="Win32 Debug" 
and 
/cfg="myProj - Win32 Debug".
- The Value is not case-sensitive.
/cl_add="<options>"Allows additional compiler options to be added to all calls to cl.exe.Enter one or more commands separated by a space character, as they would appear in the cl.exe command line. For example:
BuildConsole MyProj /cl_add="/O2 /FA"
/cl_rem="<options>"Specifies compiler options that will be removed from all calls to cl.exe.Enter one or more commands separated by a space character, as they would appear in the cl.exe command line. For example:
BuildConsole MyProj /cl_rem="/Z7 /Zd /Zi /ZI"
/CleanCleans intermediate and output files for the project(s) and all dependencies.
/compile=<source file name>When used, only the specified file(s) are built.- Value may be surrounded by quotes.
- Several source filenames may be entered, separated by commas.
/DisableDisables IncrediBuild Agent.
/DisablePdbForwarding


Disables the PDB forwarding mechanism for this build.Only relevant for Visual Studio 2010 builds.
/DumpSourceFiles=filenameWrites all of the source file paths in a project/solution to a file.<output filename> is mandatory.
/EnableEnables IncrediBuild Agent.
/HelpShows usage help and version information.
/IncrediLinkForces IncrediLink mode for this build.For VS 2008 and prior.
/IntelCLVersion="<version>"


Overrides the default Intel Compiler version.

For VS 2008 and prior.

For example: /IntelCLVersion=11.1

/link_add="<options>"Allows additional linker options to be added to all calls to link.exe.Enter one or more commands separated by a space character, as they would appear in the cl.exe command line. For example:
BuildConsole MyProj /link_add="/map:MyProj.map"
/link_rem="<options>"


Specifies linker options that will be removed from all calls to link.exe.

For VS 2008 and prior.

Enter one or more commands separated by a space character, as they would appear in the cl.exe command line. For example:
BuildConsole MyProj /link_rem="/map:MyProj.map"

/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.
/LogLevel="<Level>"Overrides the logging level for this build."<Level>" can be one of the following: Minimal, Basic, Intermediate, Extended, Detailed.
/MaxCPUS=<n>Overrides global maximum CPUs/Cores in build setting.
/MaxWinVer="<Version>"Specifies the maximal operating system required by remote Agents assigned to this build.Agents with a newer OS are not assigned to the build. Available values are: XP, 2003, VISTA, 2008, 7, 8, and 10.
/MinWinVer="<Version>"Specifies the minimal operating system required by remote Agents assigned to this build.Agents with an older OS are not assigned to the build. Available values are: XP, 2003, VISTA, 2008, 7, 8, and 10.
/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.
/msbuildargs="/myarg1 /myarg2"Passes additional arguments to MSBuild, when using the buildconsole command' - '/usemsbuild' switch.

For example:

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

/NO_DOTNET_VIRTDisables 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.
/NoIncrediLink Disables IncrediLink mode for this build.For VS 2008 and prior.
/NoLink Performs all build steps except linking.For VS 2008 and prior.
/NoLogoSuppresses the "IncrediBuild" header in the build output.
/NoRecurseBuilds only the specified project configurations, ignoring any sub-projects these configurations may have.- When used in conjunction with /Clean, this cleans only the specified configurations.
- When used in conjunction with /Rebuild, this rebuilds only the specified configurations.
/NoWaitWhen specified, if another build initiated by this Agent is already running, BuildConsole exits with a "Another build already running" message.
/OpenMonitorOpens the Build Monitor window showing the build progress.
/out=filenameRedirects entire command line output to a file.
/PresetDetermines the projects/configurations that will be built using a Preset previously saved in the Batch Build dialog.- This option is useful when a complex combination of projects and configurations is required.
- The /Preset command option replaces both the /cfg and the /prj options.
/Prj=<project name>Determines the project to be built.

- The value may be enclosed in quotes.

- Running BuildConsole on an .sln file without the /prj option will run the command on the specified solution configuration.
- The "*" and "?" characters may be used as wildcard signs when specifying project names, to perform an operation on several projects. Additionally, several project names may be entered, separated by commas. In this case, all projects are built using the same configuration name.
For example, to build all configurations in a solution/workspace, use the following syntax:
BuildConsole MyWksp /prj="*"
/QueryLicenseDisplays 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" or "Coverity". In addition, the following cores packages are supported: "4Cores", "8Cores", "12Cores", "16Cores", "24Cores", "32Cores", "48Cores" and "64Cores".
/RebuildPerforms a Clean operation before building the project.Use /SetEnv several times to set/override multiple variables.
/ResetClears the Agent's file cache content.
/SETENV="<name>=<value>"Sets or overrides environment variables for the context of the run build.
/ShowAgentShows the Agent used to build each file.
/ShowCmdShows for each file built, the command-line used by IncrediBuild to build the file.
/ShowTimeShows the Start and Finish time for each file built.
/SilentDoes not write anything to the standard output.The default behavior is to write the build results, as seen in the Output display of the Build Monitor.
/StopStops a currently running build on the local machine.BuildConsole returns the code 3 when a build has been stopped. If /stop was used and no build is currently running, 2 is returned.
/Title=<build title>Specifies a custom header line which will be displayed in the beginning of the build output text. This title will also be used for the Build History and Build Monitor displays.Value may be surrounded by quotes.
/UseEnvUses PATH, INCLUDE, LIBPATH, and LIB environment variables instead of MS Visual C++ IDE paths.- To set this option globally, use the Agent Settings dialog  box > Visual Studio Builds > AdvancedUse environment variables instead of IDE paths option.
- If a build is initiated from a Visual Studio IDE window instantiated using the devenv.exe "/useenv" command line option, this build will always use "/useenv".
/UseIDEMonitorWhen BuildConsole is run from the Visual Studio IDE with this option, the integrated IDE Build Monitor displays the build progress.
/UseMSBuildForces the usage of MSBuildBy 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.
/VsVersion="<Version>"Forces a specific version of Visual Studio toolset to be used."<Version>" can be one of the following: vc8 (for VS2005), vc9 (for VS2008), vc10 (for VS2010), vc11 (for VS2012), vc12 (for VS2013), vc14 (for VS2015), vc15 (for VS2017), and vc16 (for VS2019).
/WaitIf 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.


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:

  • Only one build at a time can be executed on a single machine. An attempt to run a build while another is running, pauses the build until the currently running build ends. Only then, does the new build begin to run.
  • In order to achieve the full potential of 'BuildConsole', take a look at the performance boosts sections.






Column
width15


Div
alignleft

Make and Other Build Tools:

Child pages (Children Display)
styleh4
pageMake and Other Build Tools Solution

User Manual:

Child pages (Children Display)
styleh4
pageIncrediBuild Windows User Manual




...