Interface IBuildAccessor
- Namespace
- Invex.Atom.Build
- Assembly
- Invex.Atom.Build.dll
Provides base functionality for accessing services and parameters within the Atom build system.
public interface IBuildAccessor
Remarks
This interface serves as a foundation for target definitions and helpers, offering convenient access to logging, file system operations, process execution, and parameter retrieval.
Properties
Logger
Gets a logger instance for the implementing type.
ILogger Logger { get; }
Property Value
- ILogger
ProcessRunner
Gets the process runner service for executing external processes.
IProcessRunner ProcessRunner { get; }
Property Value
- IProcessRunner
RootedFileSystem
Gets the Atom file system service for file and directory operations.
IRootedFileSystem RootedFileSystem { get; }
Property Value
- IRootedFileSystem
Services
Gets the service provider for resolving dependencies.
IServiceProvider Services { get; }
Property Value
- IServiceProvider
Methods
GetParam<T>(Expression<Func<T?>>, T?, Func<string?, T?>?)
Retrieves a parameter value using a strongly-typed expression.
T? GetParam<T>(Expression<Func<T?>> parameterExpression, T? defaultValue = default, Func<string?, T?>? converter = null)
Parameters
parameterExpressionExpression<Func<T>>An expression identifying the parameter (e.g.,
() => MyParam).defaultValueTThe default value to return if the parameter is not found.
converterFunc<string, T>An optional function to convert the parameter value from a string.
Returns
- T
The resolved parameter value, or the default value if not found.
Type Parameters
TThe type of the parameter.
GetService<T>()
Gets a required service from the dependency injection container.
T GetService<T>() where T : notnull
Returns
- T
The service instance.
Type Parameters
TThe type of service to retrieve.
Remarks
If the requested type T implements IBuildDefinition, this method
returns the current instance cast to that type, rather than resolving from the service provider.
GetServices<T>()
Retrieves all registered services of a specified type.
IEnumerable<T> GetServices<T>() where T : notnull
Returns
- IEnumerable<T>
A collection of service instances.
Type Parameters
TThe type of the services to retrieve.
Remarks
If the requested type T implements IBuildDefinition, this method
returns a collection containing only the current instance cast to that type.