Class OptionVersion
Option to manage the version of your build and access version info at runtime.
Inherited Members
Namespace: sttz.Trimmer.Options
Assembly: Trimmer.dll
Syntax
[Capabilities(OptionCapabilities.HasAssociatedFeature | OptionCapabilities.ConfiguresBuild | OptionCapabilities.CanPlayInEditor)]
public class OptionVersion : OptionContainer
Remarks
Unity's project version management is fragmented and differs greatly between platforms. This option attempts to unify them and provide additional features.
The version provided by this Option is based on the semantic versioning specification. Given some platform's limitations (especially iOS and Android - see below), prerelease tagging is not supported and the build number can only be an increasing positive integer.
The Option does not rely on additional files but instead uses Unity's existing settings. It does make Version available as an additional API to access a build's version with additional details like build number and version control details (commit / branch) that are not available in Unity.
In Build Profiles, the option allows to turn toggle it on/off and to override the version or build number if you need to version some builds differently from others. It also allows to toggle the inclusion of version control data in the build in case you prefer not to include it in release builds.
Two additional options can be set inside the Option script itself: shareBuildNumber and incrementBuildNumber, to set if there should be a global build number across platforms or if each platform should have their own and to set if the Option automatically increments the build number on every build.
In case shareBuildNumber is enabled, the Option checks all build numbers and uses the largest and then applies the incremented build number to all platforms. In case you want to change the build number, you can edit any platform's build number if you want to increase it but have to edit all platforms in case you want to lower it.
The Option currently only supports Git for the version control information and requires that the git command line is on the PATH.
Documentation: https://developer.android.com/studio/publish/versioning.html https://developer.apple.com/library/content/technotes/tn2420/_index.html
Fields
| Improve this Doc View SourceincrementBuildNumber
Automatically increment build number for each build.
Declaration
public bool incrementBuildNumber
Field Value
Type | Description |
---|---|
System.Boolean |
shareBuildNumber
When enabled, the build numbers between iOS/Android/MacAppStore are synchronized and used for other platforms as well. When not enabled, those platforms will have independent build numbers and all other platforms will have 0.
Declaration
public bool shareBuildNumber
Field Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceApply()
Declaration
public override void Apply()
Overrides
| Improve this Doc View SourceConfigure()
Declaration
protected override void Configure()
Overrides
| Improve this Doc View SourcePostprocessScene(Scene, OptionInclusion)
Declaration
public override void PostprocessScene(Scene scene, OptionInclusion inclusion)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.SceneManagement.Scene | scene | |
OptionInclusion | inclusion |
Overrides
| Improve this Doc View SourcePreprocessBuild(BuildTarget, String, OptionInclusion)
Declaration
public override void PreprocessBuild(BuildTarget target, string path, OptionInclusion inclusion)
Parameters
Type | Name | Description |
---|---|---|
UnityEditor.BuildTarget | target | |
System.String | path | |
OptionInclusion | inclusion |