Skip to content

Commit

Permalink
Build Version 1.1.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanMCarter committed Aug 1, 2022
1 parent 7f273af commit 5c1ff05
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 55 deletions.
Binary file removed Build Versions Change Log.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions Editor/BuildVersionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace CarterGames.Assets.BuildVersions.Editor
{
/// <summary>
/// Handles the updating of the build numbers for the asset...
/// </summary>
public class BuildVersionsManager : UnityEditor.Editor, IPreprocessBuildWithReport, IPostprocessBuildWithReport
{
//
Expand Down
58 changes: 26 additions & 32 deletions Editor/BuildVersionsMenuOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,70 @@ namespace CarterGames.Assets.BuildVersions.Editor
/// </summary>
public static class BuildVersionsMenuOptions
{
[MenuItem("Carter Games/Build Versions/Edit Info", priority = 0)]
public static void EditInfo()
{
Selection.activeObject = BuildVersionsEditorUtil.BuildInformation;
}

[MenuItem("Carter Games/Build Versions/Edit Settings", priority = 1)]
public static void EditSettings()
{
Selection.activeObject = BuildVersionsEditorUtil.BuildOptions;
}

[MenuItem("Carter Games/Build Versions/Type/Set To Prototype")]
[MenuItem("Tools/Build Versions | CG/Edit Info", priority = 0)]
public static void EditInfo() => Selection.activeObject = BuildVersionsEditorUtil.BuildInformation;

[MenuItem("Tools/Build Versions | CG/Edit Settings", priority = 1)]
public static void EditSettings() => SettingsService.OpenProjectSettings("Project/Carter Games/Build Versions");

[MenuItem("Tools/Build Versions | CG/Type/Set To Prototype")]
public static void SetToPrototype() => BuildVersionsManager.SetBuildType("Prototype");

[MenuItem("Carter Games/Build Versions/Type/Set To Development")]
[MenuItem("Tools/Build Versions | CG/Type/Set To Development")]
public static void SetToDevelopment() => BuildVersionsManager.SetBuildType("Development");

[MenuItem("Carter Games/Build Versions/Type/Set To Test")]
[MenuItem("Tools/Build Versions | CG/Type/Set To Test")]
public static void SetToTest() => BuildVersionsManager.SetBuildType("Test");

[MenuItem("Carter Games/Build Versions/Type/Alpha/Set To Pre-Alpha")]
[MenuItem("Tools/Build Versions | CG/Type/Alpha/Set To Pre-Alpha")]
public static void SetToPreAlpha() => BuildVersionsManager.SetBuildType("Pre-Alpha");

[MenuItem("Carter Games/Build Versions/Type/Alpha/Set To Closed Alpha")]
[MenuItem("Tools/Build Versions | CG/Type/Alpha/Set To Closed Alpha")]
public static void SetToClosedAlpha() => BuildVersionsManager.SetBuildType("Closed Alpha");

[MenuItem("Carter Games/Build Versions/Type/Alpha/Set To Alpha")]
[MenuItem("Tools/Build Versions | CG/Type/Alpha/Set To Alpha")]
public static void SetToAlpha() => BuildVersionsManager.SetBuildType("Alpha");

[MenuItem("Carter Games/Build Versions/Type/Alpha/Set To Open Alpha")]
[MenuItem("Tools/Build Versions | CG/Type/Alpha/Set To Open Alpha")]
public static void SetToOpenAlpha() => BuildVersionsManager.SetBuildType("Open Alpha");

[MenuItem("Carter Games/Build Versions/Type/Beta/Set To Closed Beta")]
[MenuItem("Tools/Build Versions | CG/Type/Beta/Set To Closed Beta")]
public static void SetToClosedBeta() => BuildVersionsManager.SetBuildType("Closed Beta");

[MenuItem("Carter Games/Build Versions/Type/Beta/Set To Beta")]
[MenuItem("Tools/Build Versions | CG/Type/Beta/Set To Beta")]
public static void SetToBeta() => BuildVersionsManager.SetBuildType("Beta");

[MenuItem("Carter Games/Build Versions/Type/Beta/Set To Open Beta")]
[MenuItem("Tools/Build Versions | CG/Type/Beta/Set To Open Beta")]
public static void SetToOpenBeta() => BuildVersionsManager.SetBuildType("Open Beta");

[MenuItem("Carter Games/Build Versions/Type/Release/Set To Release Candidate")]
[MenuItem("Tools/Build Versions | CG/Type/Release/Set To Release Candidate")]
public static void SetToReleaseCandidate() => BuildVersionsManager.SetBuildType("Release Candidate");

[MenuItem("Carter Games/Build Versions/Type/Release/Set To Release")]
[MenuItem("Tools/Build Versions | CG/Type/Release/Set To Release")]
public static void SetToRelease() => BuildVersionsManager.SetBuildType("Release");

[MenuItem("Carter Games/Build Versions/Date/Set Date To Today")]
[MenuItem("Tools/Build Versions | CG/Date/Set Date To Today")]
public static void SetBuildDate() => BuildVersionsManager.SetDate();

[MenuItem("Carter Games/Build Versions/Build Number/Increment Build Number")]
[MenuItem("Tools/Build Versions | CG/Build Number/Increment Build Number")]
public static void IncrementBuild() => BuildVersionsManager.SetBuildNumber();

[MenuItem("Carter Games/Build Versions/Build Number/Reset Build Number")]
[MenuItem("Tools/Build Versions | CG/Build Number/Reset Build Number")]
public static void ResetBuild() => BuildVersionsManager.SetBuildNumber(1);

[MenuItem("Carter Games/Build Versions/Version Number/Increment Major")]
[MenuItem("Tools/Build Versions | CG/Version Number/Increment Major")]
public static void IncrementMajor() => SystematicVersionUpdater.CallUpdateVersionNumber(EditorUserBuildSettings.activeBuildTarget, 0);

[MenuItem("Carter Games/Build Versions/Version Number/Increment Minor")]
[MenuItem("Tools/Build Versions | CG/Version Number/Increment Minor")]
public static void IncrementMinor() => SystematicVersionUpdater.CallUpdateVersionNumber(EditorUserBuildSettings.activeBuildTarget, 1);

[MenuItem("Carter Games/Build Versions/Version Number/Increment Build")]
[MenuItem("Tools/Build Versions | CG/Version Number/Increment Build")]
public static void IncrementVersionBuild() => SystematicVersionUpdater.CallUpdateVersionNumber(EditorUserBuildSettings.activeBuildTarget);

[MenuItem("Carter Games/Build Versions/Sync/Sync Application Version Number")]
[MenuItem("Tools/Build Versions | CG/Sync/Sync Application Version Number")]
public static void SyncVersionNumber() => BuildVersionsManager.CallSyncInterfaces();

[MenuItem("Carter Games/Build Versions/Sync/Update Cached Version Number")]
[MenuItem("Tools/Build Versions | CG/Sync/Update Cached Version Number")]
public static void UpdateCachedVersionNumber() => BuildVersionsManager.UpdateCachedVersionNumber();
}
}
39 changes: 27 additions & 12 deletions Editor/Custom Inspectors/BuildVersionsOptionsEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@ public override void OnInspectorGUI()
GUI.color = defaultTextColor;

GUILayout.Space(2.5f);
//GUI.enabled = false;
ShowValues();
//GUI.enabled = true;
GUILayout.Space(5f);

DrawLastVersionNumber();
DrawAndroidBundleCodeSection();


GUILayout.Space(5f);

EditButton();

EditorGUILayout.EndVertical();

serializedObject.ApplyModifiedProperties();
Expand Down Expand Up @@ -112,10 +114,9 @@ private void ShowLogo()
/// </summary>
private void ShowValues()
{
GUI.enabled = false;
EditorGUILayout.PropertyField(assetStatus);

GUI.enabled = assetStatus.intValue != 0;

EditorGUI.BeginChangeCheck();

var _oldSetting = buildUpdateTime.intValue;
Expand All @@ -133,8 +134,9 @@ private void ShowValues()
break;
}
}

EditorGUILayout.PropertyField(updatePlayerSettingsVersion);
GUI.enabled = true;
}


Expand All @@ -146,8 +148,7 @@ private void DrawLastVersionNumber()
GUI.color = BuildVersionsEditorUtil.TitleColour;
EditorGUILayout.LabelField("Cached Values", EditorStyles.boldLabel);
GUI.color = defaultTextColor;

//GUILayout.Space(2.5f);

GUI.enabled = false;

if (lastBuildNumber.stringValue.Length <= 0)
Expand All @@ -166,20 +167,34 @@ private void DrawLastVersionNumber()
private void DrawAndroidBundleCodeSection()
{
#if UNITY_ANDROID
GUI.enabled = false;

GUI.color = BuildVersionsEditorUtil.TitleColour;
EditorGUILayout.LabelField("Android", EditorStyles.boldLabel);
GUI.color = defaultTextColor;

//GUILayout.Space(2.5f);
//GUI.enabled = false;

GUI.enabled = assetStatus.intValue != 0;

EditorGUILayout.PropertyField(androidCodeSetting, new GUIContent("Bundle Code Update"));

//GUI.enabled = true;
GUILayout.Space(2.5f);

GUI.enabled = true;
#endif
}


/// <summary>
/// Draws a button to direct the user to the edit settings section of the asset...
/// </summary>
private void EditButton()
{
GUI.backgroundColor = BuildVersionsEditorUtil.TitleColour;

if (GUILayout.Button("Edit Settings", GUILayout.Height(22.5f)))
SettingsService.OpenProjectSettings("Project/Carter Games/Build Versions");

GUI.backgroundColor = defaultBackgroundColor;
}
}
}
3 changes: 3 additions & 0 deletions Editor/Handler/BuildHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace CarterGames.Assets.BuildVersions.Editor
{
/// <summary>
/// Handles the build dialogue results...
/// </summary>
public static class BuildHandler
{
/// <summary>
Expand Down
16 changes: 16 additions & 0 deletions Editor/Handler/HandlerDialogueData.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
namespace CarterGames.Assets.BuildVersions.Editor
{
/// <summary>
/// The data for handling build dialogue results...
/// </summary>
public class HandlerDialogueData
{
/// <summary>
/// The id of the data...
/// </summary>
public string Id;


/// <summary>
/// The choice the user made...
/// </summary>
public bool Choice;


/// <summary>
/// Constructor to setup the data class...
/// </summary>
/// <param name="id">The id to set...</param>
/// <param name="choice">The choice to set...</param>
public HandlerDialogueData(string id, bool choice)
{
Id = id;
Expand Down
13 changes: 12 additions & 1 deletion Editor/Settings/AssetVersionData.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
namespace CarterGames.Assets.BuildVersions.Editor
{
/// <summary>
/// Contains details for the asset...
/// </summary>
public static class AssetVersionData
{
/// <summary>
/// The version number of the asset...
/// </summary>
public static string VersionNumber => "1.1.0";
public static string ReleaseDate => "13/07/2022";


/// <summary>
/// The date this release of the asset was submitted for release...
/// </summary>
public static string ReleaseDate => "01/08/2022";
}
}
42 changes: 38 additions & 4 deletions Editor/Settings/BuildVersionsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

namespace CarterGames.Assets.BuildVersions.Editor
{
/// <summary>
/// Handles the settings window for the asset...
/// </summary>
public class BuildVersionsSettings : MonoBehaviour
{
private static Color defaultTextColour;

private static SerializedObject options;
private static Color defaultTextColour; // The default color of gui.color...
private static SerializedObject options; // The options asset to edit...


/// <summary>
/// Creates the settings window to show info...
/// </summary>
/// <returns></returns>
[SettingsProvider]
public static SettingsProvider BuildVersionsSettingsProvider()
{
Expand Down Expand Up @@ -44,6 +50,9 @@ public static SettingsProvider BuildVersionsSettingsProvider()
}


/// <summary>
/// Draws the logo of the asset if possible...
/// </summary>
private static void DrawLogoGroup()
{
if (!BuildVersionsEditorUtil.HasFile("BuildVersionsEditorHeader")) return;
Expand All @@ -70,6 +79,9 @@ private static void DrawLogoGroup()
}


/// <summary>
/// Draws the info of the asset...
/// </summary>
private static void DrawInfo()
{
EditorGUILayout.BeginVertical("HelpBox");
Expand All @@ -87,6 +99,9 @@ private static void DrawInfo()
}


/// <summary>
/// Draws the options section of the asset...
/// </summary>
private static void DrawOptions()
{
EditorGUILayout.BeginVertical("HelpBox");
Expand All @@ -105,12 +120,18 @@ private static void DrawOptions()
}


/// <summary>
/// Draws the enable asset option...
/// </summary>
private static void DrawEnableAsset()
{
EditorGUILayout.PropertyField(options.FindProperty("assetStatus"), new GUIContent("Asset Status"));
}


/// <summary>
/// Draws the update time option...
/// </summary>
private static void DrawUpdateBuildTime()
{
EditorGUI.BeginChangeCheck();
Expand All @@ -136,12 +157,22 @@ private static void DrawUpdateBuildTime()
}


/// <summary>
/// Draws the systematic option...
/// </summary>
private static void DrawSystematic()
{
EditorGUILayout.PropertyField(options.FindProperty("updateSystematic"), new GUIContent("Use Systematic Version"));

GUI.enabled = false;
EditorGUILayout.PropertyField(options.FindProperty("lastSystematicNumber"), new GUIContent("Cached Version Number"));
GUI.enabled = true;
}


/// <summary>
/// Draws the android bundle code option...
/// </summary>
private static void DrawAndroidBundle()
{
if (!EditorUserBuildSettings.activeBuildTarget.Equals(BuildTarget.Android)) return;
Expand All @@ -161,6 +192,9 @@ private static void DrawAndroidBundle()
}


/// <summary>
/// Draws the help buttons...
/// </summary>
private static void DrawButton()
{
EditorGUILayout.BeginHorizontal();
Expand All @@ -169,7 +203,7 @@ private static void DrawButton()
Application.OpenURL("https://assetstore.unity.com/publishers/43356");

if (GUILayout.Button("Documentation", GUILayout.Height(30), GUILayout.MinWidth(100)))
Application.OpenURL("https://carter.games/buildversions/docs");
Application.OpenURL("https://carter.games/buildversions");

if (GUILayout.Button("Change Log", GUILayout.Height(30), GUILayout.MinWidth(100)))
Application.OpenURL("https://carter.games/buildversions/changelog");
Expand Down
Loading

0 comments on commit 5c1ff05

Please sign in to comment.