Configuring MSBuild related options

TICS uses MSBuild to analyze Visual Studio projects . These in turn are checked by the Visual Studio compilers for compiler warnings (Csc for C#, VC for C++).

Basic configuration

Syntax

The following property can be configured either on SERVER or PROJECT level:

BUILDTOOLS:
  MSBUILD:
    VSBUILDRELATIONSSLNROOT: [1|0]

The following property can optionally be configured on a PROJECT level. Please, note that configuring this property on SERVER.yaml will not have any effect:

BUILDTOOLS:
  MSBUILD:
    PROJECTCONFIGPLATFORM: {}

VSBUILDRELATIONSSLNROOT

Syntax

VSBUILDRELATIONSSLNROOT: 0|1
This setting is optional; the default is 1. This means, TICS will only consider the files found in the main solution (build) file(s).

Description

The VSBUILDRELATIONSSLNROOT property can be used to allow C/C++/C# files from Visual Studio projects not to be treated as unbuildable in case the archive does not contain solution files for them.

Context

By default, any C/C++/C# files not covered by a solution file are considered dead code and unbuildable.

The VSBUILDRELATIONSSLNROOT property is used in the following contexts:

To change the default behavior, set VSBUILDRELATIONSSLNROOT: 0.

Example

BUILDTOOLS:
  MSBUILD:
    VSBUILDRELATIONSSLNROOT: 0
If there is a need to analyze source code that is not part of the main solution (.sln) file(s), configuring VSBUILDRELATIONSSLNROOT: 0 like this will make the source code buildable. If this is not configured, TICS will consider those files unreachable, therefore, not analyzing them.

PROJECTCONFIGPLATFORM

Syntax

PROJECTCONFIGPLATFORM: ""
This setting is optional and is used to set project configuration and platform for MSBuild.

Description

The PROJECTCONFIGPLATFORM property is used to override Configuration and Platform properties for MSBuild (Debug or Release, and Any CPU", "x86", and "x64" respectively).

Context

The PROJECTCONFIGPLATFORM property is used in the following contexts:

Example

BUILDTOOLS:
  MSBUILD:
    PROJECTCONFIGPLATFORM:
      test.csproj: 'Debug|AnyCPU'
Note: PROJECTCONFIGPLATFORM can also include other custom options.

Overriding Project Configuration and Platform via Command Line

Description

By using the -config option provided by TICS, it is possible to override the default Project Configuration and Platform (config|platform, or config) via Command Line.

Examples

TICSQServer -project projectName -branchname branchName -timeinfo -calc COMPILERWARNING,LOC,GLOC,ELOC,BUILDRELATIONS,PREPARE,CHANGEDFILES,INCLUDERELATIONS,FINALIZE,POSTANA -config "Release|AnyCPU"
TICS -project -calc COMPILERWARNING -config Release C:/repo/your/file/here.cs

Note: Both the solution (.sln) and the project (.csproj, .vcxproj) files have configuration settings. The contents of the -config option should match the configuration as defined in the project file (so either the .csproj or the .vcxproj file - and not the configuration as defined in the .sln file), since this matches the use case in which TICS is invoked through the Visual Studio plugin.

Note: In the case no platform is passed, TICS will match on the configuration alone. So in the case -config Release is passed, TICS will still work, but you will not have easy control over which platform is used.