Interface ISetupBuildInfo
- Namespace
- Invex.Atom.Build
- Assembly
- Invex.Atom.Build.dll
Provides the SetupBuildInfo target, which initializes core build information (name, ID, version, and timestamp) as build variables for consumption by other targets.
public interface ISetupBuildInfo : IBuildInfo, IVariablesHelper, IReportsHelper, IBuildAccessor
- Inherited Members
Properties
SetupBuildInfo
Gets the build target responsible for setting up the build ID, version, and timestamp.
Target SetupBuildInfo { get; }
Property Value
Examples
While SetupBuildInfo is often implicitly part of a default build definition, here's how a custom
target can depend on it and consume the variables it produces. Variables are consumed via the
corresponding build parameters (declared with ConsumesVariable(string, string) and read
with GetParam).
// In a target interface within your Atom build project
public interface IPackage : ISetupBuildInfo
{
Target Package => t => t
.DependsOn(nameof(ISetupBuildInfo.SetupBuildInfo)) // Ensures build info is set up
.ConsumesVariable(nameof(ISetupBuildInfo.SetupBuildInfo), nameof(BuildVersion))
.Executes(() =>
{
// BuildVersion is resolved from the variable written by SetupBuildInfo
Logger.LogInformation("Packaging {Name} version {Version}", BuildName, BuildVersion);
// ... further packaging logic ...
});
}
// To run this build (assuming Atom CLI):
// atom Package
Remarks
The SetupBuildInfo target is a foundational step in the Atom build pipeline. It performs several key
actions:
- Retrieves the build name (from BuildName) and writes it as a build variable named "BuildName".
- Retrieves the build ID (from BuildId) and writes it as a build variable named "BuildId".
- Retrieves the build version (from BuildVersion) and writes it as a build variable named "BuildVersion".
- Retrieves the build timestamp (from BuildTimestamp), converts it to a string, and writes it as a build variable named "BuildTimestamp".
- Adds a "Run Information" section to the build report, displaying the build name, version, ID, and timestamp.
-
Logs the build ID, version, and timestamp using the configured logger for
ISetupBuildInfo.
This target is marked as hidden (AsHidden()), meaning it's not typically intended for direct invocation
by users but is
expected to run as a dependency for other targets or as part of an initial setup sequence.
It produces the following build variables, which can be consumed by subsequent targets in the build process:
-
BuildNameThe name of the build. -
BuildIdThe unique identifier for the build execution. -
BuildVersionThe version of the software being built. -
BuildTimestampThe timestamp of the build (as a string).
Successful execution relies on the correct registration and functioning of IBuildIdProvider, IBuildVersionProvider, and IBuildTimestampProvider services within the Atom framework.
- See Also