Class GeneratorBase
- Namespace
- BenchmarkDotNet.Toolchains
- Assembly
- BenchmarkDotNet.dll
public abstract class GeneratorBase : IGenerator
- Inheritance
-
GeneratorBase
- Implements
- Derived
Constructors
GeneratorBase()
protected GeneratorBase()
Methods
CopyAllRequiredFiles(ArtifactsPaths)
if you need to copy some extra files to make the benchmarks work you should override this method
protected virtual void CopyAllRequiredFiles(ArtifactsPaths artifactsPaths)
Parameters
artifactsPaths
ArtifactsPaths
GenerateAppConfig(BuildPartition, ArtifactsPaths)
generates an app.config file next to the executable with benchmarks
protected virtual void GenerateAppConfig(BuildPartition buildPartition, ArtifactsPaths artifactsPaths)
Parameters
buildPartition
BuildPartitionartifactsPaths
ArtifactsPaths
GenerateBuildScript(BuildPartition, ArtifactsPaths)
generates a script can be used when debugging compilation issues
protected abstract void GenerateBuildScript(BuildPartition buildPartition, ArtifactsPaths artifactsPaths)
Parameters
buildPartition
BuildPartitionartifactsPaths
ArtifactsPaths
GenerateCode(BuildPartition, ArtifactsPaths)
generates the C# source code with all required boilerplate.
protected virtual void GenerateCode(BuildPartition buildPartition, ArtifactsPaths artifactsPaths)
Parameters
buildPartition
BuildPartitionartifactsPaths
ArtifactsPaths
GenerateNuGetConfig(ArtifactsPaths)
generates NuGet.Config file to make sure that BDN is using the right NuGet feeds
protected virtual void GenerateNuGetConfig(ArtifactsPaths artifactsPaths)
Parameters
artifactsPaths
ArtifactsPaths
GenerateProject(BuildPartition, ILogger, string)
public GenerateResult GenerateProject(BuildPartition buildPartition, ILogger logger, string rootArtifactsFolderPath)
Parameters
buildPartition
BuildPartitionlogger
ILoggerrootArtifactsFolderPath
string
Returns
GenerateProject(BuildPartition, ArtifactsPaths, ILogger)
generates .csproj file with a reference to the project with benchmarks
protected virtual void GenerateProject(BuildPartition buildPartition, ArtifactsPaths artifactsPaths, ILogger logger)
Parameters
buildPartition
BuildPartitionartifactsPaths
ArtifactsPathslogger
ILogger
GetArtifactsToCleanup(ArtifactsPaths)
returns a list of artifacts that should be removed after running the benchmarks
protected abstract string[] GetArtifactsToCleanup(ArtifactsPaths artifactsPaths)
Parameters
artifactsPaths
ArtifactsPaths
Returns
- string[]
GetBinariesDirectoryPath(string, string)
returns a path where executable should be found after the build (usually \bin)
protected virtual string GetBinariesDirectoryPath(string buildArtifactsDirectoryPath, string configuration)
Parameters
Returns
GetBuildArtifactsDirectoryPath(BuildPartition, string)
returns a path to the folder where auto-generated project and code are going to be placed
protected abstract string GetBuildArtifactsDirectoryPath(BuildPartition assemblyLocation, string programName)
Parameters
assemblyLocation
BuildPartitionprogramName
string
Returns
GetExecutableExtension()
returns OS-specific executable extension
protected virtual string GetExecutableExtension()
Returns
GetExecutablePath(string, string)
protected virtual string GetExecutablePath(string binariesDirectoryPath, string programName)
Parameters
Returns
GetIntermediateDirectoryPath(string, string)
returns a path where intermediate files should be found after the build (usually \obj)
protected virtual string GetIntermediateDirectoryPath(string buildArtifactsDirectoryPath, string configuration)
Parameters
Returns
GetPackagesDirectoryPath(string)
returns a path to the folder where NuGet packages should be restored
protected virtual string GetPackagesDirectoryPath(string buildArtifactsDirectoryPath)
Parameters
buildArtifactsDirectoryPath
string
Returns
GetProjectFilePath(string)
returns a path to the auto-generated .csproj file
protected virtual string GetProjectFilePath(string buildArtifactsDirectoryPath)
Parameters
buildArtifactsDirectoryPath
string