Build artifact is generated in /build directory or file.
Build on command line
The ProjectBuilder is accessible from the command line. It is useful when using CI tools such as Jenkins.
The following command option executes the build with the specified builder. -batchmode -buildTarget -executeMethod Mobcast.Coffee.Build.ProjectBuilder.Build -builder [-devBuildNumber ] [-appendSymbols 'INCLUDE_SYMBOL;!EXCLUDE_SYMBOL;...'] [-override ]
For example, The following command option executes the build for iOS with 'Develop_iOS' builder asset, with DEBUG_MODE symbol. -batchmode -buildTarget ios -executeMethod Mobcast.Coffee.Build.ProjectBuilder.Build -builder 'Default iOS' -appendSymbols DEBUG_MODE
Note: DO NOT USE-quit option. For other infomation, see this link :
Override builder with json
-override to override builder setting. For example as following.
Disable symbol 'DEVELOPMENT_BUILD' and enable symbol 'FAKE_PURCHASE'
To override other parameters, convert the builder to json from Convert to JSON (console log) in project builder window.
Build on Unity Cloud Build(UCB)
Type Mobcast.Coffee.Build.ProjectBuilder.PreExport at Config > Advanced Settings > Pre-Export Method Name on UCB.
Builder asset used for building will be selected automatically based on build setting label. For example, a build setting labeled 'Default iOS' on UCB, selects builder asset named 'Default iOS' in project.
How to customize the builder for your project?
Click Create Custom Project Builder Script
Save script with dialog.
Implement the script. The serialized field is not only displayed in the inspector, it can also be used in PostProcessBuild as following.
cs
[SerializeField] string stringParameter;
[PostProcessBuild]
protectedstaticvoidOnPostProcessBuild(BuildTarget target, string path)
{
CustomProjectBuilder current = Util.currentBuilder as CustomProjectBuilder;
Debug.Log(current.stringParameter);
...
}
How to add a supported build target to build?
Implement IBuildTargetSettings interface as following for build targets you need.
Add System.Serializable attribute to the class to be serializable.