Class BuildStep
Base class for build steps that are executed througout a BuildPipeline.
Namespace: Unity.Build
Syntax
public abstract class BuildStep : IBuildStep
Properties
Description
Description of this BuildStep displayed in build progress reporting.
Declaration
public abstract string Description { get; }
Property Value
Type | Description |
---|---|
String |
Implements
OptionalComponents
List of IBuildSettingsComponent derived types that are optional for this BuildStep.
Declaration
public virtual Type[] OptionalComponents { get; }
Property Value
Type | Description |
---|---|
Type[] |
Implements
RequiredComponents
List of IBuildSettingsComponent derived types that are required for this BuildStep.
Declaration
public virtual Type[] RequiredComponents { get; }
Property Value
Type | Description |
---|---|
Type[] |
Implements
Methods
CleanupBuildStep(BuildContext)
Declaration
public virtual BuildStepResult CleanupBuildStep(BuildContext context)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
BuildStepResult |
Implements
Failure(String)
Construct BuildStepResult from this IBuildStep that represent a failed execution.
Declaration
public BuildStepResult Failure(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message | Message that explain why the IBuildStep execution failed. |
Returns
Type | Description |
---|---|
BuildStepResult | A new BuildStepResult instance. |
GetAvailableTypes(Func<Type, Boolean>)
Retrieves a list of valid types for build steps.
Declaration
public static IReadOnlyCollection<Type> GetAvailableTypes(Func<Type, bool> filter = null)
Parameters
Type | Name | Description |
---|---|---|
Func<Type, Boolean> | filter | Optional filter function for types. |
Returns
Type | Description |
---|---|
IReadOnlyCollection<Type> | List of available build step types. |
GetOptionalComponent(BuildContext, Type)
Get the value of an optional Type component from BuildSettings. The component Type must exist in the OptionalComponents list. If the component is not found in BuildSettings, a new instance of type Type is returned.
Declaration
public IBuildSettingsComponent GetOptionalComponent(BuildContext context, Type type)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Type | type | Type of the optional component. |
Returns
Type | Description |
---|---|
IBuildSettingsComponent | The value of the optional component. |
GetOptionalComponent<T>(BuildContext)
Get the value of an optional T
component from BuildSettings.
The component Type must exist in the OptionalComponents list.
If the component is not found in BuildSettings, a new instance of type T
is returned.
Declaration
public T GetOptionalComponent<T>(BuildContext context)
where T : IBuildSettingsComponent
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
T | The value of the optional component. |
Type Parameters
Name | Description |
---|---|
T | Type of the optional component. |
GetOptionalComponents(BuildContext)
Get all optional components from BuildSettings. Optional component types not found in BuildSettings will be set to a new instance of that type.
Declaration
public IEnumerable<IBuildSettingsComponent> GetOptionalComponents(BuildContext context)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
IEnumerable<IBuildSettingsComponent> | List of optional components. |
GetOptionalComponents(BuildContext, Type)
Get all optional components from BuildSettings, that matches Type. Optional component types not found in BuildSettings will be set to a new instance of that type.
Declaration
public IEnumerable<IBuildSettingsComponent> GetOptionalComponents(BuildContext context, Type type)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Type | type | Type of the components. |
Returns
Type | Description |
---|---|
IEnumerable<IBuildSettingsComponent> | List of optional components. |
GetOptionalComponents<T>(BuildContext)
Get all optional components from BuildSettings, that matches T
.
Optional component types not found in BuildSettings will be set to a new instance of that type.
Declaration
public IEnumerable<T> GetOptionalComponents<T>(BuildContext context)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
IEnumerable<T> | List of optional components. |
Type Parameters
Name | Description |
---|---|
T | Type of the components. |
GetRequiredComponent(BuildContext, Type)
Get the value of a required Type component from BuildSettings. The component Type must exist in the RequiredComponents list.
Declaration
public IBuildSettingsComponent GetRequiredComponent(BuildContext context, Type type)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Type | type | Type of the required component. |
Returns
Type | Description |
---|---|
IBuildSettingsComponent | The value of the required component. |
GetRequiredComponent<T>(BuildContext)
Get the value of a required T
component from BuildSettings.
The component Type must exist in the RequiredComponents list.
Declaration
public T GetRequiredComponent<T>(BuildContext context)
where T : IBuildSettingsComponent
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
T | The value of the required component. |
Type Parameters
Name | Description |
---|---|
T | Type of the required component. |
GetRequiredComponents(BuildContext)
Get all required components from BuildSettings.
Declaration
public IEnumerable<IBuildSettingsComponent> GetRequiredComponents(BuildContext context)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
IEnumerable<IBuildSettingsComponent> | List of required components. |
GetRequiredComponents(BuildContext, Type)
Get all required components from BuildSettings, that matches Type.
Declaration
public IEnumerable<IBuildSettingsComponent> GetRequiredComponents(BuildContext context, Type type)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Type | type | Type of the components. |
Returns
Type | Description |
---|---|
IEnumerable<IBuildSettingsComponent> | List of required components. |
GetRequiredComponents<T>(BuildContext)
Get all required components from BuildSettings, that matches T
.
Declaration
public IEnumerable<T> GetRequiredComponents<T>(BuildContext context)
where T : IBuildSettingsComponent
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
IEnumerable<T> | List of required components. |
Type Parameters
Name | Description |
---|---|
T | Type of the components. |
HasOptionalComponent(BuildContext, Type)
Determine if an optional Type component is stored in BuildSettings. The component Type must exist in the OptionalComponents list.
Declaration
public bool HasOptionalComponent(BuildContext context, Type type)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Type | type | Type of the optional component. |
Returns
Type | Description |
---|---|
Boolean | true if the optional component type is found, false otherwise. |
HasOptionalComponent<T>(BuildContext)
Determine if an optional T
component is stored in BuildSettings.
The component Type must exist in the OptionalComponents list.
Declaration
public bool HasOptionalComponent<T>(BuildContext context)
where T : IBuildSettingsComponent
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
Boolean | true if the optional component type is found, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Type of the optional component. |
HasRequiredComponent(BuildContext, Type)
Determine if a required Type component is stored in BuildSettings. The component Type must exist in the RequiredComponents list.
Declaration
public bool HasRequiredComponent(BuildContext context, Type type)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Type | type | Type of the required component. |
Returns
Type | Description |
---|---|
Boolean | true if the required component type is found, false otherwise. |
HasRequiredComponent<T>(BuildContext)
Determine if a required T
component is stored in BuildSettings.
The component Type must exist in the RequiredComponents list.
Declaration
public bool HasRequiredComponent<T>(BuildContext context)
where T : IBuildSettingsComponent
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
Boolean | true if the required component type is found, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Type of the required component. |
IsEnabled(BuildContext)
Determine if this BuildStep will be executed or not.
Declaration
public virtual bool IsEnabled(BuildContext context)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
Boolean | true if enabled, false otherwise. |
Implements
RunBuildStep(BuildContext)
Declaration
public abstract BuildStepResult RunBuildStep(BuildContext context)
Parameters
Type | Name | Description |
---|---|---|
BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
Type | Description |
---|---|
BuildStepResult | The result of running this BuildStep. |
Implements
Success()
Construct BuildStepResult from this IBuildStep that represent a successful execution.
Declaration
public BuildStepResult Success()
Returns
Type | Description |
---|---|
BuildStepResult | A new BuildStepResult instance. |