From 05e994d262180f22e99c9ef2d54fe13208329a0f Mon Sep 17 00:00:00 2001 From: Robin North Date: Thu, 29 Apr 2021 15:38:48 +0100 Subject: [PATCH] Increment build numbers for supported platforms when generating version string, closes #71 --- CHANGELOG.md | 1 + Editor/Build/BuildProject.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96798a1..8e08ffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Increment build numbers for supported platforms when generating version string. [Issue #71](https://github.com/superunitybuild/buildtool/issues/71) - Allow BuildActions to draw custom serialized property fields ### Changed diff --git a/Editor/Build/BuildProject.cs b/Editor/Build/BuildProject.cs index 85566d1..c86cd96 100644 --- a/Editor/Build/BuildProject.cs +++ b/Editor/Build/BuildProject.cs @@ -174,6 +174,11 @@ public static string GenerateVersionString(ProductParameters productParameters, productParameters.lastGeneratedVersion = retVal; PlayerSettings.bundleVersion = retVal; + // Increment build numbers for supported platforms + PlayerSettings.Android.bundleVersionCode = PlayerSettings.Android.bundleVersionCode + 1; + PlayerSettings.iOS.buildNumber = $"{int.Parse(PlayerSettings.iOS.buildNumber) + 1}"; + PlayerSettings.macOS.buildNumber = $"{int.Parse(PlayerSettings.macOS.buildNumber) + 1}"; + return retVal; }