From 7e2b4954358879266a13854645ba84cfe32d5373 Mon Sep 17 00:00:00 2001 From: Lorenz Junglas Date: Thu, 8 Oct 2020 13:34:42 +0200 Subject: [PATCH] Adressed Review Identifier "macOS" => "MacOS" Platform/SDK name reverted to "osx" --- .../GodotTools/GodotTools/Build/MsBuildFinder.cs | 2 +- .../GodotTools/GodotTools/Export/AotBuilder.cs | 6 +++--- .../GodotTools/GodotTools/Export/ExportPlugin.cs | 4 ++-- .../editor/GodotTools/GodotTools/GodotSharpEditor.cs | 6 +++--- .../GodotTools/GodotTools/Ides/GodotIdeManager.cs | 2 +- .../GodotTools/Ides/MonoDevelop/Instance.cs | 6 +++--- .../GodotTools/Ides/Rider/RiderPathLocator.cs | 6 +++--- .../mono/editor/GodotTools/GodotTools/Utils/OS.cs | 12 ++++++------ 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs index 6674901b8a6..93aae2e03ec 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs @@ -119,7 +119,7 @@ namespace GodotTools.Build { var result = new List(); - if (OS.IsmacOS) + if (OS.IsMacOS) { result.Add("/Library/Frameworks/Mono.framework/Versions/Current/bin/"); result.Add("/usr/local/var/homebrew/linked/mono/bin/"); diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs b/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs index 01b1064eb39..5bb8d444c23 100755 --- a/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs @@ -120,7 +120,7 @@ namespace GodotTools.Export string assemblyPath = assembly.Value; string outputFileExtension = platform == OS.Platforms.Windows ? ".dll" : - platform == OS.Platforms.macOS ? ".dylib" : + platform == OS.Platforms.MacOS ? ".dylib" : ".so"; string outputFileName = assemblyName + ".dll" + outputFileExtension; @@ -132,7 +132,7 @@ namespace GodotTools.Export ExecuteCompiler(FindCrossCompiler(compilerDirPath), compilerArgs, bclDir); - if (platform == OS.Platforms.macOS) + if (platform == OS.Platforms.MacOS) { exporter.AddSharedObject(tempOutputFilePath, tags: null); } @@ -581,7 +581,7 @@ MONO_AOT_MODE_LAST = 1000, string arch = bits == "64" ? "x86_64" : "i686"; return $"windows-{arch}"; } - case OS.Platforms.macOS: + case OS.Platforms.MacOS: { Debug.Assert(bits == null || bits == "64"); string arch = "x86_64"; diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs index 8a46410c9fe..cd188509b49 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs @@ -340,7 +340,7 @@ namespace GodotTools.Export private static bool PlatformHasTemplateDir(string platform) { // OSX export templates are contained in a zip, so we place our custom template inside it and let Godot do the rest. - return !new[] {OS.Platforms.macOS, OS.Platforms.Android, OS.Platforms.iOS, OS.Platforms.HTML5}.Contains(platform); + return !new[] {OS.Platforms.MacOS, OS.Platforms.Android, OS.Platforms.iOS, OS.Platforms.HTML5}.Contains(platform); } private static bool DeterminePlatformFromFeatures(IEnumerable features, out string platform) @@ -411,7 +411,7 @@ namespace GodotTools.Export case OS.Platforms.Windows: case OS.Platforms.UWP: return "net_4_x_win"; - case OS.Platforms.macOS: + case OS.Platforms.MacOS: case OS.Platforms.LinuxBSD: case OS.Platforms.Server: case OS.Platforms.Haiku: diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs index 3368bdc53dc..57d334b93e2 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs +++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs @@ -272,7 +272,7 @@ namespace GodotTools bool osxAppBundleInstalled = false; - if (OS.IsmacOS) + if (OS.IsMacOS) { // The package path is '/Applications/Visual Studio Code.app' const string vscodeBundleId = "com.microsoft.VSCode"; @@ -312,7 +312,7 @@ namespace GodotTools string command; - if (OS.IsmacOS) + if (OS.IsMacOS) { if (!osxAppBundleInstalled && string.IsNullOrEmpty(_vsCodePath)) { @@ -504,7 +504,7 @@ namespace GodotTools $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" + $",JetBrains Rider:{(int)ExternalEditorId.Rider}"; } - else if (OS.IsmacOS) + else if (OS.IsMacOS) { settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudioForMac}" + $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" + diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs index 1874513888b..451ce39f5ca 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs @@ -111,7 +111,7 @@ namespace GodotTools.Ides { MonoDevelop.Instance GetMonoDevelopInstance(string solutionPath) { - if (Utils.OS.IsmacOS && editorId == ExternalEditorId.VisualStudioForMac) + if (Utils.OS.IsMacOS && editorId == ExternalEditorId.VisualStudioForMac) { vsForMacInstance = (vsForMacInstance?.IsDisposed ?? true ? null : vsForMacInstance) ?? new MonoDevelop.Instance(solutionPath, MonoDevelop.EditorId.VisualStudioForMac); diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs index cd3c93b8413..fd7bbd55785 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs @@ -26,7 +26,7 @@ namespace GodotTools.Ides.MonoDevelop string command; - if (OS.IsmacOS) + if (OS.IsMacOS) { string bundleId = BundleIds[editorId]; @@ -85,7 +85,7 @@ namespace GodotTools.Ides.MonoDevelop public Instance(string solutionFile, EditorId editorId) { - if (editorId == EditorId.VisualStudioForMac && !OS.IsmacOS) + if (editorId == EditorId.VisualStudioForMac && !OS.IsMacOS) throw new InvalidOperationException($"{nameof(EditorId.VisualStudioForMac)} not supported on this platform"); this.solutionFile = solutionFile; @@ -103,7 +103,7 @@ namespace GodotTools.Ides.MonoDevelop static Instance() { - if (OS.IsmacOS) + if (OS.IsMacOS) { ExecutableNames = new Dictionary { diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs index 7f4e92d7d52..94fc5da425c 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs @@ -32,7 +32,7 @@ namespace GodotTools.Ides.Rider { return CollectRiderInfosWindows(); } - if (OS.IsmacOS) + if (OS.IsMacOS) { return CollectRiderInfosMac(); } @@ -138,7 +138,7 @@ namespace GodotTools.Ides.Rider return GetToolboxRiderRootPath(localAppData); } - if (OS.IsmacOS) + if (OS.IsMacOS) { var home = Environment.GetEnvironmentVariable("HOME"); if (string.IsNullOrEmpty(home)) @@ -211,7 +211,7 @@ namespace GodotTools.Ides.Rider { if (OS.IsWindows || OS.IsUnixLike) return "../../build.txt"; - if (OS.IsmacOS) + if (OS.IsMacOS) return "Contents/Resources/build.txt"; throw new Exception("Unknown OS."); } diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs index 53a929b7ee9..e7459664352 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs @@ -21,7 +21,7 @@ namespace GodotTools.Utils public static class Names { public const string Windows = "Windows"; - public const string macOS = "macOS"; + public const string MacOS = "macOS"; public const string Linux = "Linux"; public const string FreeBSD = "FreeBSD"; public const string NetBSD = "NetBSD"; @@ -37,7 +37,7 @@ namespace GodotTools.Utils public static class Platforms { public const string Windows = "windows"; - public const string macOS = "macos"; + public const string MacOS = "osx"; public const string LinuxBSD = "linuxbsd"; public const string Server = "server"; public const string UWP = "uwp"; @@ -50,7 +50,7 @@ namespace GodotTools.Utils public static readonly Dictionary PlatformNameMap = new Dictionary { [Names.Windows] = Platforms.Windows, - [Names.macOS] = Platforms.macOS, + [Names.MacOS] = Platforms.MacOS, [Names.Linux] = Platforms.LinuxBSD, [Names.FreeBSD] = Platforms.LinuxBSD, [Names.NetBSD] = Platforms.LinuxBSD, @@ -77,11 +77,11 @@ namespace GodotTools.Utils new[] {Names.Linux, Names.FreeBSD, Names.NetBSD, Names.BSD}; private static readonly IEnumerable UnixLikePlatforms = - new[] {Names.macOS, Names.Server, Names.Haiku, Names.Android, Names.iOS} + new[] {Names.MacOS, Names.Server, Names.Haiku, Names.Android, Names.iOS} .Concat(LinuxBSDPlatforms).ToArray(); private static readonly Lazy _isWindows = new Lazy(() => IsOS(Names.Windows)); - private static readonly Lazy _ismacOS = new Lazy(() => IsOS(Names.macOS)); + private static readonly Lazy _isMacOS = new Lazy(() => IsOS(Names.MacOS)); private static readonly Lazy _isLinuxBSD = new Lazy(() => IsAnyOS(LinuxBSDPlatforms)); private static readonly Lazy _isServer = new Lazy(() => IsOS(Names.Server)); private static readonly Lazy _isUWP = new Lazy(() => IsOS(Names.UWP)); @@ -92,7 +92,7 @@ namespace GodotTools.Utils private static readonly Lazy _isUnixLike = new Lazy(() => IsAnyOS(UnixLikePlatforms)); public static bool IsWindows => _isWindows.Value || IsUWP; - public static bool IsmacOS => _ismacOS.Value; + public static bool IsMacOS => _isMacOS.Value; public static bool IsLinuxBSD => _isLinuxBSD.Value; public static bool IsServer => _isServer.Value; public static bool IsUWP => _isUWP.Value;