Class CsProjGenerator
- Namespace
- BenchmarkDotNet.Toolchains.CsProj
- Assembly
- BenchmarkDotNet.dll
public class CsProjGenerator : DotNetCliGenerator, IGenerator, IEquatable<CsProjGenerator>
- Inheritance
-
CsProjGenerator
- Implements
- Derived
- Inherited Members
Constructors
CsProjGenerator(string, string, string, string, bool)
public CsProjGenerator(string targetFrameworkMoniker, string cliPath, string packagesPath, string runtimeFrameworkVersion, bool isNetCore = true)
Parameters
targetFrameworkMoniker
stringcliPath
stringpackagesPath
stringruntimeFrameworkVersion
stringisNetCore
bool
Properties
RuntimeFrameworkVersion
public string RuntimeFrameworkVersion { get; }
Property Value
Methods
Equals(CsProjGenerator)
public bool Equals(CsProjGenerator other)
Parameters
other
CsProjGenerator
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GenerateProject(BuildPartition, ArtifactsPaths, ILogger)
generates .csproj file with a reference to the project with benchmarks
protected override void GenerateProject(BuildPartition buildPartition, ArtifactsPaths artifactsPaths, ILogger logger)
Parameters
buildPartition
BuildPartitionartifactsPaths
ArtifactsPathslogger
ILogger
GetBinariesDirectoryPath(string, string)
returns a path where executable should be found after the build (usually \bin)
protected override string GetBinariesDirectoryPath(string buildArtifactsDirectoryPath, string configuration)
Parameters
Returns
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
GetHashCode()
public override int GetHashCode()
Returns
GetIntermediateDirectoryPath(string, string)
returns a path where intermediate files should be found after the build (usually \obj)
protected override string GetIntermediateDirectoryPath(string buildArtifactsDirectoryPath, string configuration)
Parameters
Returns
GetProjectFilePath(string)
returns a path to the auto-generated .csproj file
protected override string GetProjectFilePath(string buildArtifactsDirectoryPath)
Parameters
buildArtifactsDirectoryPath
string
Returns
GetProjectFilePath(Type, ILogger)
returns a path to the project file which defines the benchmarks
protected virtual FileInfo GetProjectFilePath(Type benchmarkTarget, ILogger logger)
Parameters
Returns
GetRuntimeSettings(GcMode, IResolver)
returns an MSBuild string that defines Runtime settings
protected virtual string GetRuntimeSettings(GcMode gcMode, IResolver resolver)