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
targetFrameworkMonikerstringcliPathstringpackagesPathstringruntimeFrameworkVersionstringisNetCorebool
Properties
RuntimeFrameworkVersion
public string RuntimeFrameworkVersion { get; }
Property Value
Methods
Equals(CsProjGenerator)
public bool Equals(CsProjGenerator other)
Parameters
otherCsProjGenerator
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
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
buildPartitionBuildPartitionartifactsPathsArtifactsPathsloggerILogger
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
buildPartitionBuildPartitionprogramNamestring
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetProjectFilePath(string)
returns a path to the auto-generated .csproj file
protected override string GetProjectFilePath(string buildArtifactsDirectoryPath)
Parameters
buildArtifactsDirectoryPathstring
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)