Skip to content

Commit

Permalink
📦 1.2.2 Release Upload
Browse files Browse the repository at this point in the history
- Fix for switch build platform not compiling in Unity 6 or newer
- Minor comment updates etc.
  • Loading branch information
JonathanMCarter committed Nov 23, 2024
1 parent d768dc9 commit c20ed86
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 27 deletions.
12 changes: 6 additions & 6 deletions Carter Games/Build Versions/Code/Editor/BuildVersionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void UpdateCachedVersionNumber()

if (!SemanticVersionUpdater.IsInSemanticFormat(grabbed))
{
BvLog.Normal("Unable to cache latest as it doesn't match the semantic formatting of \"x.y.z\"");
BVLogger.Normal("Unable to cache latest as it doesn't match the semantic formatting of \"x.y.z\"");
return;
}

Expand Down Expand Up @@ -133,7 +133,7 @@ public void OnPreprocessBuild(BuildReport report)
// Stops if the asset is disabled from updating the build number...
if (settings.Status == AssetUsageType.Disabled)
{
BvLog.Warning("Asset is disabled, will not update any build numbers this build.");
BVLogger.Warning("Asset is disabled, will not update any build numbers this build.");
return;
}

Expand Down Expand Up @@ -192,7 +192,7 @@ private static void CallUpdaterInterfaces(BuildTarget target)

if (listeners.Length <= 0)
{
BvLog.Error("No updaters found, so nothing will happen!");
BVLogger.Error("No updaters found, so nothing will happen!");
return;
}

Expand All @@ -211,15 +211,15 @@ public static void CallSyncInterfaces()
// Stops the sync if the user is not using semantic updating...
if (UtilEditor.BuildOptions.SemanticUsageType == AssetUsageType.Disabled)
{
BvLog.Warning("Update semantic is disabled! Sync will not run while this setting is disabled.");
BVLogger.Warning("Update semantic is disabled! Sync will not run while this setting is disabled.");
return;
}

var listeners = UtilEditor.GetAllInterfacesOfType<ISyncable>();

if (listeners.Length <= 0)
{
BvLog.Normal("No sync implementations found, so nothing will happen!");
BVLogger.Normal("No sync implementations found, so nothing will happen!");
return;
}

Expand All @@ -239,7 +239,7 @@ private static void CallRelevantDialogueBoxes(BuildTarget target)

if (listeners.Length <= 0)
{
BvLog.Normal("No dialogue implementations found, ignoring.");
BVLogger.Normal("No dialogue implementations found, ignoring.");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace CarterGames.Assets.BuildVersions.Editor
{
/// <summary>
/// Handles the custom inspector for the Save Manager asset index.
/// Handles the custom inspector for the Build Versions asset index.
/// </summary>
[CustomEditor(typeof(AssetIndex))]
public sealed class BuildVersionsAssetIndexInspector : UnityEditor.Editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class BuildVersionsSettings : MonoBehaviour
[SettingsProvider]
public static SettingsProvider BuildVersionsSettingsProvider()
{
var provider = new SettingsProvider("Project/Carter Games/Build Versions", SettingsScope.Project)
var provider = new SettingsProvider("Carter Games/Build Versions", SettingsScope.Project)
{
guiHandler = (searchContext) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static void OnEditorUpdate()


/// <summary>
/// Updates the index with all the save manager asset scriptable objects in the project.
/// Updates the index with all the build versions asset scriptable objects in the project.
/// </summary>
[MenuItem("Tools/Carter Games/Build Versions/Update Asset Index", priority = 17)]
public static void UpdateIndex()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void OnBuildVersionIncremented(BuildTarget buildTarget)

if (info == null)
{
BvLog.Error("Unable to update data as it was not found in the project!");
BVLogger.Error("Unable to update data as it was not found in the project!");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,13 @@ public static string GetVersionNumber(BuildTarget buildTarget, bool updatedNumbe
: PlayerSettings.tvOS.buildNumber;
case BuildTarget.Switch:
return updatedNumber
#if UNITY_6000_0_OR_NEWER
? UpdateVersionNumber(PlayerSettings.bundleVersion)
: PlayerSettings.bundleVersion;
#else
? UpdateVersionNumber(PlayerSettings.Switch.releaseVersion)
: PlayerSettings.Switch.releaseVersion;
#endif
#if UNITY_2022_2_X_OR_NEWER
case BuildTarget.Lumin:
return updatedNumber
Expand All @@ -158,7 +163,7 @@ public static string GetVersionNumber(BuildTarget buildTarget, bool updatedNumbe
? UpdateVersionNumber(PlayerSettings.bundleVersion)
: PlayerSettings.bundleVersion;
default:
BvLog.Error("Unable to increment build number, platform not recognised!");
BVLogger.Error("Unable to increment build number, platform not recognised!");
return string.Empty;
}
}
Expand Down Expand Up @@ -207,8 +212,12 @@ public static void CallUpdateVersionNumber(BuildTarget buildTarget, int numberTo
PlayerSettings.tvOS.buildNumber = UpdateVersionNumber(PlayerSettings.tvOS.buildNumber, numberToUpdate);
break;
case BuildTarget.Switch:
#if UNITY_6000_0_OR_NEWER
PlayerSettings.bundleVersion = UpdateVersionNumber(PlayerSettings.bundleVersion, numberToUpdate);
#else
PlayerSettings.Switch.releaseVersion = UpdateVersionNumber(PlayerSettings.Switch.releaseVersion, numberToUpdate);
PlayerSettings.Switch.displayVersion = UpdateVersionNumber(PlayerSettings.Switch.displayVersion, numberToUpdate);
#endif
break;
#if UNITY_2022_2_X_OR_NEWER
case BuildTarget.Lumin:
Expand All @@ -219,7 +228,7 @@ public static void CallUpdateVersionNumber(BuildTarget buildTarget, int numberTo
PlayerSettings.bundleVersion = UpdateVersionNumber(PlayerSettings.bundleVersion, numberToUpdate);
break;
default:
BvLog.Error("Unable to increment build number, platform not recognised!");
BVLogger.Error("Unable to increment build number, platform not recognised!");
break;
}
}
Expand All @@ -239,7 +248,7 @@ private static string UpdateVersionNumber(string input, int valueToIncrement = 2
// If the build version format is incorrect... complain about it and don't increment the number...
if (versionParts.Length != 3 || !int.TryParse(versionParts[valueToIncrement], out var buildNumber))
{
BvLog.Error("Unable to update player settings build version, please make sure you are using a major, minor, patch (x.x.x) style format in your player settings");
BVLogger.Error("Unable to update player settings build version, please make sure you are using a major, minor, patch (x.x.x) style format in your player settings");
return input;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public static class AssetVersionData
/// <summary>
/// The version number of the asset...
/// </summary>
public static string VersionNumber => "1.2.1";
public static string VersionNumber => "1.2.2";


/// <summary>
/// The date this release of the asset was submitted for release...
/// The date this release of the asset was submitted for release. (Y/M/D)
/// </summary>
public static string ReleaseDate => "05/03/2024";
public static string ReleaseDate => "2024/11/23";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public struct AssetVersionInfo

public static readonly GUIContent Date =
new GUIContent(
"Release date",
"Release date (Y/M/D)",
"The date the version of the asset you are using was released on.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public static AssetIndex Index
───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

/// <summary>
/// Gets the Save Manager Asset requested.
/// Gets the Build Versions Asset requested.
/// </summary>
/// <typeparam name="T">The save manager asset to get.</typeparam>
/// <typeparam name="T">The build versions asset to get.</typeparam>
/// <returns>The asset if it exists.</returns>
public static T GetAsset<T>() where T : BuildVersionsAsset
{
Expand All @@ -80,9 +80,9 @@ public static T GetAsset<T>() where T : BuildVersionsAsset


/// <summary>
/// Gets the Save Manager Asset requested.
/// Gets the Build Versions Asset requested.
/// </summary>
/// <typeparam name="T">The save manager asset to get.</typeparam>
/// <typeparam name="T">The build versions asset to get.</typeparam>
/// <returns>The asset if it exists.</returns>
public static List<T> GetAssets<T>() where T : BuildVersionsAsset
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected string Parse(string toParse)

if (split.Length < 3)
{
BvLog.Warning("Unable to display patch of the semantic versioning number as it does not exist.");
BVLogger.Warning("Unable to display patch of the semantic versioning number as it does not exist.");
break;
}

Expand All @@ -145,7 +145,7 @@ protected string Parse(string toParse)
split = buildInformation.SemanticVersionNumber.Split('.');
if (split.Length < 2)
{
BvLog.Warning("Unable to display minor of the semantic versioning number as it does not exist.");
BVLogger.Warning("Unable to display minor of the semantic versioning number as it does not exist.");
break;
}

Expand All @@ -156,7 +156,7 @@ protected string Parse(string toParse)
split = buildInformation.SemanticVersionNumber.Split('.');
if (split.Equals(string.Empty))
{
BvLog.Warning("Unable to display major of the semantic versioning number as it does not exist.");
BVLogger.Warning("Unable to display major of the semantic versioning number as it does not exist.");
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace CarterGames.Assets.BuildVersions
/// <summary>
/// Handles the logs thrown by the asset...
/// </summary>
public static class BvLog
public static class BVLogger
{
/* —————————————————————————————————————————————————————————————————————————————————————————————————————————————
| Fields
Expand Down

Large diffs are not rendered by default.

0 comments on commit c20ed86

Please sign in to comment.