Show / Hide Table of Contents

Class BuildManager

The Build Manager controls the build process and calls the Option's callbacks.

Inheritance
System.Object
BuildManager
Implements
UnityEditor.Build.IProcessSceneWithReport
UnityEditor.Build.IPreprocessBuildWithReport
UnityEditor.Build.IPostprocessBuildWithReport
UnityEditor.Build.IOrderedCallback
Namespace: sttz.Trimmer.Editor
Assembly: Trimmer-Editor.dll
Syntax
public class BuildManager : IProcessSceneWithReport, IPreprocessBuildWithReport, IPostprocessBuildWithReport, IOrderedCallback

Fields

| Improve this Doc View Source

NO_TRIMMER

Scripting define symbol added to remove Trimmer code in player.

Declaration
public const string NO_TRIMMER = "NO_TRIMMER"
Field Value
Type Description
System.String

Properties

| Improve this Doc View Source

callbackOrder

Declaration
public int callbackOrder { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

CommandLineBuildPath

The output path set using the command line option -output "PATH". (Only set then IsCommandLineBuild is true).

Declaration
public static string CommandLineBuildPath { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

IsCommandLineBuild

Wether the current build was started on the command line using -executeMethod sttz.Trimmer.Editor.BuildManager.Build.

Declaration
public static bool IsCommandLineBuild { get; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

Build()

Build the profile specified on the command line or the active profile.

Declaration
public static string Build()
Returns
Type Description
System.String
Remarks

You can use this method to automate Unity builds using the command line.

Use the following command to build a Build Profile: unity -quit -batchmode -executeMethod sttz.Trimmer.Editor.BuildManager.Build -profileName "PROFILE_NAME"

You need to replace unity with the path to the Unity executable and PROFILE_NAME with the name of the profile you want to build. Run this in the folder of your Unity project or add -projectPath "PATH_TO_PROJECT" to select one.

When doing a command line build, the path set by the profile is used. If the profile doesn't set a path or you want to override it, add the -output "PATH" option to the arguments.

See the Unity documentation for more information on command line usage.

| Improve this Doc View Source

Build(BuildProfile)

Build a profile for its default targets and with the default build options.

Declaration
public static string Build(BuildProfile profile)
Parameters
Type Name Description
BuildProfile profile
Returns
Type Description
System.String
| Improve this Doc View Source

Build(BuildProfile, BuildPlayerOptions)

Build a profile with the given build options.

Declaration
public static string Build(BuildProfile buildProfile, BuildPlayerOptions options)
Parameters
Type Name Description
BuildProfile buildProfile
UnityEditor.BuildPlayerOptions options
Returns
Type Description
System.String
Remarks

The BuildPlayerOptions will be passed through the profile's Options' PrepareBuild(BuildPlayerOptions, OptionInclusion), which can modify it before the build is started.

Note

If you do not set options.locationPathName and no option sets it in the PrepareBuild callback, then a save dialog will be shown.

| Improve this Doc View Source

GetCurrentScriptingDefineSymbols(BuildTargetGroup)

Convenience method to get the current scripting define symbols as a hash set (instead of a colon-delimited string).

Declaration
protected HashSet<string> GetCurrentScriptingDefineSymbols(BuildTargetGroup targetGroup)
Parameters
Type Name Description
UnityEditor.BuildTargetGroup targetGroup
Returns
Type Description
System.Collections.Generic.HashSet<System.String>
| Improve this Doc View Source

GetDefaultOptions(BuildTarget)

Populate the BuildPlayerOptions with default values.

Declaration
public static BuildPlayerOptions GetDefaultOptions(BuildTarget target)
Parameters
Type Name Description
UnityEditor.BuildTarget target
Returns
Type Description
UnityEditor.BuildPlayerOptions
| Improve this Doc View Source

OnBuildError(BuildTarget, String)

Declaration
public static void OnBuildError(BuildTarget target, string error)
Parameters
Type Name Description
UnityEditor.BuildTarget target
System.String error
| Improve this Doc View Source

OnPostprocessBuild(BuildReport)

Declaration
public void OnPostprocessBuild(BuildReport report)
Parameters
Type Name Description
UnityEditor.Build.Reporting.BuildReport report
| Improve this Doc View Source

OnPreprocessBuild(BuildReport)

Declaration
public void OnPreprocessBuild(BuildReport report)
Parameters
Type Name Description
UnityEditor.Build.Reporting.BuildReport report
| Improve this Doc View Source

OnProcessScene(Scene, BuildReport)

Declaration
public void OnProcessScene(Scene scene, BuildReport report)
Parameters
Type Name Description
UnityEngine.SceneManagement.Scene scene
UnityEditor.Build.Reporting.BuildReport report
| Improve this Doc View Source

UnityCloudBuild(BuildManifestObject)

Entry point for Unity Cloud builds.

Declaration
public static void UnityCloudBuild(BuildManifestObject manifest)
Parameters
Type Name Description
BuildManifestObject manifest
Remarks

If you don't configure anything, Unity Cloud Build will build without a profile, all Options will use their default value and will be removed.

Add the name of the Build Profile you want to build with to the target name in Unity Cloud Build, enclosed in double underscores, e.g. __Profile Name__. Note that since the target name can contain only alphanumeric characters, spaces, dashes and underscores, those characters cannot appear in the profile name either.

Also note that the ability for Options to set build options is limited, currently only setting a custom scene list is supported.

Implements

UnityEditor.Build.IProcessSceneWithReport
UnityEditor.Build.IPreprocessBuildWithReport
UnityEditor.Build.IPostprocessBuildWithReport
UnityEditor.Build.IOrderedCallback
  • Improve this Doc
  • View Source
Back to top © 2017 Adrian Stutz