Interface IBuildInfo
Provides centralized access to essential build metadata, such as version, name, and identifiers.
public interface IBuildInfo : IBuildAccessor
- Inherited Members
Remarks
This interface defines parameters that supply consistent build information throughout the execution lifecycle. For values that change over time (e.g., BuildTimestamp), it is recommended to consume them from ISetupBuildInfo. This ensures that a stable value is captured at the start of the workflow and reused across all targets, providing consistency.
Properties
BuildId
Gets the unique identifier for the current build run.
[ParamDefinition("build-id", "The unique identifier for the build run.", ParamSource.All, null)]
string BuildId { get; }
Property Value
- string
Remarks
This value can be overridden using the --build-id parameter. If not provided, it defaults to the
value from the registered IBuildIdProvider.
BuildName
Gets the human-readable name of the build, derived from the solution or root directory name.
[ParamDefinition("build-name", "The name of the build.", ParamSource.All, null)]
string BuildName { get; }
Property Value
- string
Remarks
This value can be overridden using the --build-name parameter. If not provided, it is automatically
determined by searching for a .slnx or .sln file in the root directory and using its name.
If no solution file is found, it defaults to the name of the root directory.
BuildSlice
Gets an optional identifier for a specific variation of a build, often used in CI/CD matrix jobs.
[ParamDefinition("build-slice", "An identifier for a build variation, used in matrix jobs.", ParamSource.All, null)]
string? BuildSlice { get; }
Property Value
- string
Remarks
This value can be configured using the --build-slice parameter. It is useful for distinguishing
between parallel build jobs (e.g., different target frameworks or operating systems). It is null if not
specified.
BuildTimestamp
Gets the build timestamp as a Unix epoch timestamp (seconds).
[ParamDefinition("build-timestamp", "The build timestamp in Unix epoch seconds.", ParamSource.All, null)]
long BuildTimestamp { get; }
Property Value
- long
Remarks
This value can be overridden using the --build-timestamp parameter. If not provided, it defaults to the
timestamp from the registered IBuildTimestampProvider.
Warning: This value may be inconsistent across different process instances. For a stable timestamp, consume this parameter from ISetupBuildInfo so that a consistent value is used across all targets.
BuildVersion
Gets the semantic version of the build.
[ParamDefinition("build-version", "The semantic version of the build.", ParamSource.All, null)]
SemVer BuildVersion { get; }
Property Value
- SemVer
Remarks
This value can be overridden using the --build-version parameter. If not provided, it defaults to the
version from the registered IBuildVersionProvider. The value is automatically parsed into a
Invex.SemanticVersion.SemVer object.