Skip to content

MSBuild tasks

Steve Gilham edited this page May 7, 2019 · 22 revisions

Both the .net framework/mono and .net core releases publish MSBuld tasks from the main assembly (AltCover.exe or AltCover.dll, respectively) that wrap the command-line functionality (as documented here under Usage).

Task AltCover.Prepare

This is the instrumentation mode with --opencover --save --inplace as default. Associated parameters are

InputDirectory
OutputDirectory
SymbolDirectories†
Dependencies†*
Keys†⁋
StrongNameKey⁋
XmlReport
FileFilter†
PathFilter†
AssemblyFilter†
AssemblyExcludeFilter†
TypeFilter†
MethodFilter†
AttributeFilter†
CallContext†
OpenCover‡
InPlace‡
Save‡
Single⁑ 
LineCover⁑ 
BranchCover⁑ 
ExposeReturnCode‡ 

plus for v 5.0+

CommandLine†
SourceLink⁑ (v5.1)
Defer⁑ (v5.3)

or for v 4.0

CommandLine // [<Obsolete>]
Command†

plus for where these parameters are all optional strings (default empty) except as noted
† = optional array of strings, default empty
‡ = Boolean, default true
⁋ = Mono/.net Framework build only
* = .net core builds only
⁑ = Boolean, default false

Task AltCover.Collect

This is runner mode with --collect as default. Associated parameters are

RecorderDirectory⸸
WorkingDirectory
Executable
LcovReport
Threshold
Cobertura
OutputFile
ExposeReturnCode‡ 

plus for v 5.0+

CommandLine†
SummaryFormat (v 5.2)
Summary ✣ (v5.2)

or for v 4.0

CommandLine // [<Obsolete>]
Command†

with all these parameters being optional strings (default empty) except as noted
⸸ denotes a [Required] parameter
† = optional array of strings, default empty
‡ = Boolean, default true
✣ = denotes a [Output] string parameter

Task AltCover.PowerShell

This is the ipmo option and takes no parameters

Task AltCover.GetVersion

This is the version option and takes no parameters

Task AltCover.Echo (v5.2)

This writes a string to stdout

Text⸸
Colour

with all these parameters being optional strings (default empty) except as noted
⸸ denotes a [Required] parameter

General

The task parameters match the command line arguments in name and function, except that SymbolDirectories is pluralised, and the deprecated CommandLine is everything after a -- as one single string. If AltCover.Collect's Executable parameter is set, that switches the virtual --collect flag off.

You can’t perform that action at this time.