Class DotNetCliGenerator
- Namespace
- BenchmarkDotNet.Toolchains.DotNetCli
- Assembly
- BenchmarkDotNet.dll
public abstract class DotNetCliGenerator : GeneratorBase, IGenerator
- Inheritance
-
DotNetCliGenerator
- Implements
- Derived
- Inherited Members
Constructors
DotNetCliGenerator(string, string, string, bool)
protected DotNetCliGenerator(string targetFrameworkMoniker, string cliPath, string packagesPath, bool isNetCore)
Parameters
Properties
CliPath
public string CliPath { get; }
Property Value
IsNetCore
protected bool IsNetCore { get; }
Property Value
PackagesPath
public string PackagesPath { get; }
Property Value
TargetFrameworkMoniker
public string TargetFrameworkMoniker { get; }
Property Value
Methods
CopyAllRequiredFiles(ArtifactsPaths)
if you need to copy some extra files to make the benchmarks work you should override this method
protected override void CopyAllRequiredFiles(ArtifactsPaths artifactsPaths)
Parameters
artifactsPaths
ArtifactsPaths
GenerateBuildScript(BuildPartition, ArtifactsPaths)
generates a script can be used when debugging compilation issues
protected override void GenerateBuildScript(BuildPartition buildPartition, ArtifactsPaths artifactsPaths)
Parameters
buildPartition
BuildPartitionartifactsPaths
ArtifactsPaths
GetArtifactsToCleanup(ArtifactsPaths)
returns a list of artifacts that should be removed after running the benchmarks
protected override string[] GetArtifactsToCleanup(ArtifactsPaths artifactsPaths)
Parameters
artifactsPaths
ArtifactsPaths
Returns
- string[]
GetBuildArtifactsDirectoryPath(BuildPartition, string)
we need our folder to be on the same level as the project that we want to reference we are limited by xprojs (by default compiles all .cs files in all subfolders, Program.cs could be doubled and fail the build) and also by NuGet internal implementation like looking for global.json file in parent folders
protected override string GetBuildArtifactsDirectoryPath(BuildPartition buildPartition, string programName)
Parameters
buildPartition
BuildPartitionprogramName
string
Returns
GetExecutableExtension()
returns OS-specific executable extension
protected override string GetExecutableExtension()
Returns
GetPackagesDirectoryPath(string)
returns a path to the folder where NuGet packages should be restored
protected override string GetPackagesDirectoryPath(string buildArtifactsDirectoryPath)
Parameters
buildArtifactsDirectoryPath
string