Class BuildProfile
Build Profiles configure builds. They define which Options are included, how the Options are configured and give Options a chance to influence the build process.
Inheritance
Namespace: sttz.Trimmer.Editor
Assembly: Trimmer-Editor.dll
Syntax
[CreateAssetMenu(fileName = "Build Profile.asset", menuName = "Trimmer/Build Profile")]
[HelpURL("https://sttz.ch/trimmer/manual/using_trimmer.html")]
public class BuildProfile : EditableProfile
Remarks
A project can contain multiple Build Profiles and each profile can build multiple platforms at once. A Build Profile contains the configuration values for all Options and configures if an Option or its associated feature are included in the build.
The EditorProfile is used to configure the project when playing in the editor.
In the build, OptionPrompt and OptionIniFile can be used to change the included Options' configuration.
See the BuildManager for methods to build profiles.
Properties
| Improve this Doc View SourceAllBuildProfiles
Enumeration of all build profiles in the current project.
Declaration
public static IEnumerable<BuildProfile> AllBuildProfiles { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<BuildProfile> |
BuildTargets
The build targets this profile will create builds for.
Declaration
public IEnumerable<BuildTarget> BuildTargets { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<UnityEditor.BuildTarget> |
Remarks
If the profile doesn't define any targets, this method will return the active build target.
EditProfile
Declaration
public override RuntimeProfile EditProfile { get; }
Property Value
Type | Description |
---|---|
RuntimeProfile |
Overrides
| Improve this Doc View SourceEmptyEditProfile
Edit profile used when there's no active build profile.
Declaration
public static RuntimeProfile EmptyEditProfile { get; }
Property Value
Type | Description |
---|---|
RuntimeProfile |
Store
Declaration
public override ValueStore Store { get; }
Property Value
Type | Description |
---|---|
ValueStore |
Overrides
Methods
| Improve this Doc View SourceActivateProfile()
Declaration
[ContextMenu("Activate Profile")]
public void ActivateProfile()
AddBuildTarget(BuildTarget)
Add a build target to the profile.
Declaration
public void AddBuildTarget(BuildTarget target)
Parameters
Type | Name | Description |
---|---|---|
UnityEditor.BuildTarget | target |
EditOption(Option)
Declaration
public override void EditOption(Option option)
Parameters
Type | Name | Description |
---|---|---|
Option | option |
Overrides
| Improve this Doc View SourceFind(String)
Look for a Build Profile by its name (case insensitive).
Declaration
public static BuildProfile Find(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
BuildProfile |
GetInclusionOf(Option)
Check if an Option should be included in builds of this profile.
Declaration
public OptionInclusion GetInclusionOf(Option option)
Parameters
Type | Name | Description |
---|---|---|
Option | option |
Returns
Type | Description |
---|---|
OptionInclusion |
GetLastBuildPath(BuildTarget)
Get the path to the last build of this profile for the given target.
Declaration
public string GetLastBuildPath(BuildTarget target)
Parameters
Type | Name | Description |
---|---|---|
UnityEditor.BuildTarget | target |
Returns
Type | Description |
---|---|
System.String | The path or null if no path is recorded. |
Remarks
Build paths are only saved on the instance and are lost once Unity does a domain reload or restarts.
RemoveBuildTarget(BuildTarget)
Remove a build target form the profile.
Declaration
public void RemoveBuildTarget(BuildTarget target)
Parameters
Type | Name | Description |
---|---|---|
UnityEditor.BuildTarget | target |
Remarks
Note
If the profile has no build targets set, it will build the active build target.
SaveIfNeeded()
Declaration
public override void SaveIfNeeded()
Overrides
| Improve this Doc View SourceSetLastBuildPath(BuildTarget, String)
Declaration
public void SetLastBuildPath(BuildTarget target, string path)
Parameters
Type | Name | Description |
---|---|---|
UnityEditor.BuildTarget | target | |
System.String | path |
UsesActiveBuildTarget()
Returns wether the profile has no explicit build targets set and builds the active build target instead.
Declaration
public bool UsesActiveBuildTarget()
Returns
Type | Description |
---|---|
System.Boolean |