Using the native Unity Package Manager introduced in 2017.2, you can add this library as a package by modifying your
manifest.json
file found at /ProjectName/Packages/manifest.json
to include it as a dependency. See the example below
on how to reference it.
The package is available on the npmjs registry.
{
"dependencies": {
...
},
"scopedRegistries": [
{
"name": "Playdarium",
"url": "https://registry.npmjs.org",
"scopes": [
"com.playdarium.unity"
]
}
]
}
Open Window -> Package Manager
choose Packages: My Regestries
and install package
"com.playdarium.unity.build-pipeline": "https://gitlab.com/pd-packages/build-pipeline.git#upm"
All resources for build must be located in the Editor resources folder.
- Create from
Create -> BuildPipeline -> BuildProjectPipeline
. - Setup pipeline name.
- Setup build target.
- Configure your own pipeline steps.
- Launch build you can from menu
Tools -> Build Pipelines
Field name | Description |
---|---|
Pipeline Name | This name should be unique and using for invoke remote build |
Build Target | Using for build grouping in Build Pipelines window |
Steps | Pipeline steps for configure and build project |
Step name | Description |
---|---|
ProductName | Set product name |
PackageName | Set package name for selected platform |
KeystoreAndAlias | Set keystore and alias |
Define | Set defines for selected platform |
LogLevel | Set log level |
BuildAppBundle | Build apk or aab (Android) |
ScriptingBackendAndroidMono | Set scripting backend android to mono |
ScriptingBackendAndroidIL2CPP | Set scripting backend android to IL2CPP |
BuildAndStore | Setup configuration in scriptable object BuildSettings |
AddBuildCountToVersion | Used in Android for build Debug version |
SetIOSBuildNumber | Used for change build number on build agent |
UnityLogo | Enable or disable unity logo in build |
SceneToBuild | Provide scene path to build |
AndroidBuild | Execute build Android project |
iOSBuild | Export iOS project for XCode |
Create directories:
BuildPipleines -> Editor -> Resporces -> Pipelines
BuildPipleines -> Editor -> Resporces -> Steps
In Resources
create scriptable object Create -> Settings -> BuildSettings
Create 3 different pipelines Create -> BuildPipeline -> BuildProjectPipeline
- AndroidDebug
- AndroidReleaseAPK
- AndroidReleaseAAB
Add to this pipelines steps Create -> BuildPipeline -> Steps
Step Name | Value |
---|---|
BuildAndStore | BuildType: Debug StoreType: GooglePlay |
KeystoreAndAlias | Empty |
BuildAppBundle | False |
ScriptingBackendAndroidMono | - |
AddBuildCountToVersion | - |
UnityLogo | False |
SceneToBuild | Scenes in project |
AndroidBuild | ProjectPrefix: [custom_value] BuildOptions: Development |
Step Name | Value |
---|---|
BuildAndStore | BuildType: Release StoreType: GooglePlay |
KeystoreAndAlias | Set your values |
BuildAppBundle | False |
ScriptingBackendAndroidIL2CPP | - |
UnityLogo | False |
SceneToBuild | Scenes in project |
AndroidBuild | ProjectPrefix: [custom_value] BuildOptions: None |
Step Name | Value |
---|---|
BuildAndStore | BuildType: Release StoreType: GooglePlay |
KeystoreAndAlias | Set your values |
BuildAppBundle | True |
ScriptingBackendAndroidIL2CPP | - |
UnityLogo | False |
SceneToBuild | Scenes in project |
AndroidBuild | ProjectPrefix: [custom_value] BuildOptions: None |
For avoid exception when XCode build project:
Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable
- On the menu bar, select Window > General, then select Services.
- In the Services window, select Cloud Diagnostics.
- Disable Cloud Diagnostics.
Create 3 different pipelines Create -> BuildPipeline -> BuildProjectPipeline
- iOSDebugBuild
- iOSReleaseBuild
Add to this pipelines steps Create -> BuildPipeline -> Steps
Step Name | Value |
---|---|
BuildAndStore | BuildType: Debug StoreType: iOS |
SetIOSBuildNumber | - |
UnityLogo | False |
SceneToBuild | Scenes in project |
iOSBuild | ProjectPrefix: [custom_value] BuildOptions: Development BuildType: Debug ExportOptionsEnabled: True CompileBitcode: False StripSwiftSymbols: True DevelopmentProvision: [path_to_file] DistributionProvision: [path_to_file] |
Step Name | Value |
---|---|
BuildAndStore | BuildType: Release StoreType: iOS |
SetIOSBuildNumber | - |
UnityLogo | False |
SceneToBuild | Scenes in project |
iOSBuild | ProjectPrefix: [custom_value] BuildOptions: None BuildType: Release ExportOptionsEnabled: True CompileBitcode: True StripSwiftSymbols: True DevelopmentProvision: [path_to_file] DistributionProvision: [path_to_file] |
For create you own build pipeline step you must implement APipelineStep
and
override method:
public override void Execute(BuildParameterHolder parameterHolder, Action onComplete)
Your pipeline step can execute a recompile project and BuildPipelineExecutor
restore
a building process after assembly reload.
If you need provide some variables between steps use BuildParameterHolder
.
For serialization BuildParameterHolder
use BinaryFormatter
.
Launch unity with arguments:
-executeMethod Playdarium.BuildPipelines.BuildPipelineExecutor.Build -pipelineName [PipelineName] -buildPath [BuildPath]