Table of Contents

Class ProfileRegistry

Namespace
Ando.Profiles
Assembly
ando.dll

Registry for managing build profiles. Tracks defined profiles (from script) and active profiles (from CLI).

public class ProfileRegistry
Inheritance
ProfileRegistry
Inherited Members

Properties

ActiveProfiles

Gets the names of all active (CLI-requested) profiles.

public IReadOnlyCollection<string> ActiveProfiles { get; }

Property Value

IReadOnlyCollection<string>

DefinedProfiles

Gets the names of all defined profiles.

public IReadOnlyCollection<string> DefinedProfiles { get; }

Property Value

IReadOnlyCollection<string>

Methods

Define(string)

Defines a profile in the build script. Returns a Profile object that can be used in conditionals.

public Profile Define(string name)

Parameters

name string

The profile name.

Returns

Profile

A Profile instance for use in if statements.

IsActive(string)

Checks if a profile is currently active (was passed via CLI).

public bool IsActive(string name)

Parameters

name string

The profile name to check.

Returns

bool

True if the profile is active.

SetActiveProfiles(IEnumerable<string>)

Sets the active profiles from CLI arguments. Call this before loading the build script.

public void SetActiveProfiles(IEnumerable<string> profiles)

Parameters

profiles IEnumerable<string>

Profile names from CLI (e.g., from -p push,release).

Validate()

Validates that all active profiles were defined in the script. Call this after script loading but before workflow execution.

public void Validate()

Exceptions

InvalidOperationException

Thrown when an active profile was not defined in the script.