Class BuildStep
Base class for build steps that are executed througout a BuildPipeline.
Namespace: Unity.Build
Syntax
public abstract class BuildStep : IBuildStep
Properties
Category
Category name of this BuildStep displayed in the searcher menu.
Declaration
public string Category { get; }
Property Value
| Type | Description |
|---|---|
| String |
Description
Description of this BuildStep displayed in build progress reporting.
Declaration
public string Description { get; }
Property Value
| Type | Description |
|---|---|
| String |
IsShown
Determine if this BuildStep should be displayed in the inspector and searcher menu.
Declaration
public bool IsShown { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Name
The name of this BuildStep.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| String |
OptionalComponents
List of IBuildComponent derived types that are optional for this BuildStep.
Declaration
public virtual Type[] OptionalComponents { get; }
Property Value
| Type | Description |
|---|---|
| Type[] |
RequiredComponents
List of IBuildComponent derived types that are required for this BuildStep.
Declaration
public virtual Type[] RequiredComponents { get; }
Property Value
| Type | Description |
|---|---|
| Type[] |
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 |
Failure(String)
Construct BuildStepResult from this BuildStep that represent a failed execution.
Declaration
public BuildStepResult Failure(string message)
Parameters
| Type | Name | Description |
|---|---|---|
| String | message | Message that explain why the BuildStep execution failed. |
Returns
| Type | Description |
|---|---|
| BuildStepResult | A new BuildStepResult instance. |
GetCategory(Type)
Get the category name displayed in the searcher menu of a BuildStep type.
Declaration
public static string GetCategory(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The BuildStep type. |
Returns
| Type | Description |
|---|---|
| String | The BuildStep's category name. |
GetCategory<T>()
Get the category name displayed in the searcher menu of a BuildStep type.
Declaration
public static string GetCategory<T>()
where T : IBuildStep
Returns
| Type | Description |
|---|---|
| String | The BuildStep's category name. |
Type Parameters
| Name | Description |
|---|---|
| T | The BuildStep type. |
GetDescription(Type)
Get the description displayed in build progress reporting of a BuildStep type.
Declaration
public static string GetDescription(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The BuildStep type. |
Returns
| Type | Description |
|---|---|
| String | The BuildStep's description. |
GetDescription<T>()
Get the description displayed in build progress reporting of a BuildStep type.
Declaration
public static string GetDescription<T>()
where T : IBuildStep
Returns
| Type | Description |
|---|---|
| String | The BuildStep's description. |
Type Parameters
| Name | Description |
|---|---|
| T | The BuildStep type. |
GetIsShown(Type)
Determine if a BuildStep type should be displayed in the inspector and searcher menu.
Declaration
public static bool GetIsShown(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The BuildStep type. |
Returns
| Type | Description |
|---|---|
| Boolean | true if the BuildStep is shown, false otherwise. |
GetIsShown<T>()
Determine if a BuildStep type should be displayed in the inspector and searcher menu.
Declaration
public static bool GetIsShown<T>()
where T : IBuildStep
Returns
| Type | Description |
|---|---|
| Boolean | true if the BuildStep is shown, false otherwise. |
Type Parameters
| Name | Description |
|---|---|
| T | The BuildStep type. |
GetName(Type)
Get the name of a BuildStep type.
Declaration
public static string GetName(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The BuildStep type. |
Returns
| Type | Description |
|---|---|
| String | The BuildStep's name. |
GetName<T>()
Get the name of a BuildStep type.
Declaration
public static string GetName<T>()
where T : IBuildStep
Returns
| Type | Description |
|---|---|
| String | The BuildStep's name. |
Type Parameters
| Name | Description |
|---|---|
| T | The BuildStep type. |
GetOptionalComponent(BuildContext, Type)
Get the value of an optional Type component from BuildConfiguration. The component Type must exist in the OptionalComponents list. If the component is not found in BuildConfiguration, a new instance of type Type is returned.
Declaration
public IBuildComponent 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 |
|---|---|
| IBuildComponent | The value of the optional component. |
GetOptionalComponent<T>(BuildContext)
Get the value of an optional T component from BuildConfiguration.
The component Type must exist in the OptionalComponents list.
If the component is not found in BuildConfiguration, a new instance of type T is returned.
Declaration
public T GetOptionalComponent<T>(BuildContext context)
where T : IBuildComponent
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 BuildConfiguration. Optional component types not found in BuildConfiguration will be set to a new instance of that type.
Declaration
public IEnumerable<IBuildComponent> GetOptionalComponents(BuildContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IBuildComponent> | List of optional components. |
GetOptionalComponents(BuildContext, Type)
Get all optional components from BuildConfiguration, that matches Type. Optional component types not found in BuildConfiguration will be set to a new instance of that type.
Declaration
public IEnumerable<IBuildComponent> 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<IBuildComponent> | List of optional components. |
GetOptionalComponents<T>(BuildContext)
Get all optional components from BuildConfiguration, that matches T.
Optional component types not found in BuildConfiguration 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 BuildConfiguration. The component Type must exist in the RequiredComponents list.
Declaration
public IBuildComponent 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 |
|---|---|
| IBuildComponent | The value of the required component. |
GetRequiredComponent<T>(BuildContext)
Get the value of a required T component from BuildConfiguration.
The component Type must exist in the RequiredComponents list.
Declaration
public T GetRequiredComponent<T>(BuildContext context)
where T : IBuildComponent
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 BuildConfiguration.
Declaration
public IEnumerable<IBuildComponent> GetRequiredComponents(BuildContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| BuildContext | context | The BuildContext used by the execution of this BuildStep. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IBuildComponent> | List of required components. |
GetRequiredComponents(BuildContext, Type)
Get all required components from BuildConfiguration, that matches Type.
Declaration
public IEnumerable<IBuildComponent> 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<IBuildComponent> | List of required components. |
GetRequiredComponents<T>(BuildContext)
Get all required components from BuildConfiguration, that matches T.
Declaration
public IEnumerable<T> GetRequiredComponents<T>(BuildContext context)
where T : IBuildComponent
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 BuildConfiguration. 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 BuildConfiguration.
The component Type must exist in the OptionalComponents list.
Declaration
public bool HasOptionalComponent<T>(BuildContext context)
where T : IBuildComponent
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 BuildConfiguration. 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 BuildConfiguration.
The component Type must exist in the RequiredComponents list.
Declaration
public bool HasRequiredComponent<T>(BuildContext context)
where T : IBuildComponent
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. |
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. |
Success()
Construct BuildStepResult from this BuildStep that represent a successful execution.
Declaration
public BuildStepResult Success()
Returns
| Type | Description |
|---|---|
| BuildStepResult | A new BuildStepResult instance. |