A build versioner that uses perforce to stamp the latest commit along with major/minor version.
To install via Package Manager:
- In editor, Window > Package Manager
- Click the + button at the top left
- "Add package from git URL..."
- Copy this repo:
https://github.com/glacay30/build-versioner.git
To install locally:
- Download this repo
- Copy files directly into
Assets/BuildVersioner/
- Window > Build Versioner
- Add your workspace name and test with
Get Changelist Number
- If an error mentions your username, make sure to set it with
Set Username
- If an error mentions session expired, open and login to the perforce client
- If an error mentions your username, make sure to set it with
- Set the Major and Minor versions
Note: These changes are local to your machine and will not be tracked in source control.
The only public API with this package is through BuildVersioner.BVInfo
, so use this class when you want to access the BV data. An example of a script using BVInfo might look as simple as:
public class Example : MonoBehaviour
{
private void Start()
{
var text = GetComponent<Text>();
text.text = BuildVersioner.BVInfo.GetVersionFormatted();
}
}
Which during Play would look like this: