ソースを参照

Adressed Review

Identifier "macOS" => "MacOS"
Platform/SDK name reverted to "osx"
Lorenz Junglas 4 年 前
コミット
7e2b495435

+ 1 - 1
modules/mono/editor/GodotTools/GodotTools/Build/MsBuildFinder.cs

@@ -119,7 +119,7 @@ namespace GodotTools.Build
             {
             {
                 var result = new List<string>();
                 var result = new List<string>();
 
 
-                if (OS.IsmacOS)
+                if (OS.IsMacOS)
                 {
                 {
                     result.Add("/Library/Frameworks/Mono.framework/Versions/Current/bin/");
                     result.Add("/Library/Frameworks/Mono.framework/Versions/Current/bin/");
                     result.Add("/usr/local/var/homebrew/linked/mono/bin/");
                     result.Add("/usr/local/var/homebrew/linked/mono/bin/");

+ 3 - 3
modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs

@@ -120,7 +120,7 @@ namespace GodotTools.Export
                 string assemblyPath = assembly.Value;
                 string assemblyPath = assembly.Value;
 
 
                 string outputFileExtension = platform == OS.Platforms.Windows ? ".dll" :
                 string outputFileExtension = platform == OS.Platforms.Windows ? ".dll" :
-                    platform == OS.Platforms.macOS ? ".dylib" :
+                    platform == OS.Platforms.MacOS ? ".dylib" :
                     ".so";
                     ".so";
 
 
                 string outputFileName = assemblyName + ".dll" + outputFileExtension;
                 string outputFileName = assemblyName + ".dll" + outputFileExtension;
@@ -132,7 +132,7 @@ namespace GodotTools.Export
 
 
                 ExecuteCompiler(FindCrossCompiler(compilerDirPath), compilerArgs, bclDir);
                 ExecuteCompiler(FindCrossCompiler(compilerDirPath), compilerArgs, bclDir);
 
 
-                if (platform == OS.Platforms.macOS)
+                if (platform == OS.Platforms.MacOS)
                 {
                 {
                     exporter.AddSharedObject(tempOutputFilePath, tags: null);
                     exporter.AddSharedObject(tempOutputFilePath, tags: null);
                 }
                 }
@@ -581,7 +581,7 @@ MONO_AOT_MODE_LAST = 1000,
                         string arch = bits == "64" ? "x86_64" : "i686";
                         string arch = bits == "64" ? "x86_64" : "i686";
                         return $"windows-{arch}";
                         return $"windows-{arch}";
                     }
                     }
-                case OS.Platforms.macOS:
+                case OS.Platforms.MacOS:
                     {
                     {
                         Debug.Assert(bits == null || bits == "64");
                         Debug.Assert(bits == null || bits == "64");
                         string arch = "x86_64";
                         string arch = "x86_64";

+ 2 - 2
modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs

@@ -340,7 +340,7 @@ namespace GodotTools.Export
         private static bool PlatformHasTemplateDir(string platform)
         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.
             // 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<string> features, out string platform)
         private static bool DeterminePlatformFromFeatures(IEnumerable<string> features, out string platform)
@@ -411,7 +411,7 @@ namespace GodotTools.Export
                 case OS.Platforms.Windows:
                 case OS.Platforms.Windows:
                 case OS.Platforms.UWP:
                 case OS.Platforms.UWP:
                     return "net_4_x_win";
                     return "net_4_x_win";
-                case OS.Platforms.macOS:
+                case OS.Platforms.MacOS:
                 case OS.Platforms.LinuxBSD:
                 case OS.Platforms.LinuxBSD:
                 case OS.Platforms.Server:
                 case OS.Platforms.Server:
                 case OS.Platforms.Haiku:
                 case OS.Platforms.Haiku:

+ 3 - 3
modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs

@@ -272,7 +272,7 @@ namespace GodotTools
 
 
                     bool osxAppBundleInstalled = false;
                     bool osxAppBundleInstalled = false;
 
 
-                    if (OS.IsmacOS)
+                    if (OS.IsMacOS)
                     {
                     {
                         // The package path is '/Applications/Visual Studio Code.app'
                         // The package path is '/Applications/Visual Studio Code.app'
                         const string vscodeBundleId = "com.microsoft.VSCode";
                         const string vscodeBundleId = "com.microsoft.VSCode";
@@ -312,7 +312,7 @@ namespace GodotTools
 
 
                     string command;
                     string command;
 
 
-                    if (OS.IsmacOS)
+                    if (OS.IsMacOS)
                     {
                     {
                         if (!osxAppBundleInstalled && string.IsNullOrEmpty(_vsCodePath))
                         if (!osxAppBundleInstalled && string.IsNullOrEmpty(_vsCodePath))
                         {
                         {
@@ -504,7 +504,7 @@ namespace GodotTools
                                    $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
                                    $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" +
                                    $",JetBrains Rider:{(int)ExternalEditorId.Rider}";
                                    $",JetBrains Rider:{(int)ExternalEditorId.Rider}";
             }
             }
-            else if (OS.IsmacOS)
+            else if (OS.IsMacOS)
             {
             {
                 settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudioForMac}" +
                 settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudioForMac}" +
                                    $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +
                                    $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" +

+ 1 - 1
modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs

@@ -111,7 +111,7 @@ namespace GodotTools.Ides
                 {
                 {
                     MonoDevelop.Instance GetMonoDevelopInstance(string solutionPath)
                     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) ??
                             vsForMacInstance = (vsForMacInstance?.IsDisposed ?? true ? null : vsForMacInstance) ??
                                                new MonoDevelop.Instance(solutionPath, MonoDevelop.EditorId.VisualStudioForMac);
                                                new MonoDevelop.Instance(solutionPath, MonoDevelop.EditorId.VisualStudioForMac);

+ 3 - 3
modules/mono/editor/GodotTools/GodotTools/Ides/MonoDevelop/Instance.cs

@@ -26,7 +26,7 @@ namespace GodotTools.Ides.MonoDevelop
 
 
             string command;
             string command;
 
 
-            if (OS.IsmacOS)
+            if (OS.IsMacOS)
             {
             {
                 string bundleId = BundleIds[editorId];
                 string bundleId = BundleIds[editorId];
 
 
@@ -85,7 +85,7 @@ namespace GodotTools.Ides.MonoDevelop
 
 
         public Instance(string solutionFile, EditorId editorId)
         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");
                 throw new InvalidOperationException($"{nameof(EditorId.VisualStudioForMac)} not supported on this platform");
 
 
             this.solutionFile = solutionFile;
             this.solutionFile = solutionFile;
@@ -103,7 +103,7 @@ namespace GodotTools.Ides.MonoDevelop
 
 
         static Instance()
         static Instance()
         {
         {
-            if (OS.IsmacOS)
+            if (OS.IsMacOS)
             {
             {
                 ExecutableNames = new Dictionary<EditorId, string>
                 ExecutableNames = new Dictionary<EditorId, string>
                 {
                 {

+ 3 - 3
modules/mono/editor/GodotTools/GodotTools/Ides/Rider/RiderPathLocator.cs

@@ -32,7 +32,7 @@ namespace GodotTools.Ides.Rider
                 {
                 {
                     return CollectRiderInfosWindows();
                     return CollectRiderInfosWindows();
                 }
                 }
-                if (OS.IsmacOS)
+                if (OS.IsMacOS)
                 {
                 {
                     return CollectRiderInfosMac();
                     return CollectRiderInfosMac();
                 }
                 }
@@ -138,7 +138,7 @@ namespace GodotTools.Ides.Rider
                 return GetToolboxRiderRootPath(localAppData);
                 return GetToolboxRiderRootPath(localAppData);
             }
             }
 
 
-            if (OS.IsmacOS)
+            if (OS.IsMacOS)
             {
             {
                 var home = Environment.GetEnvironmentVariable("HOME");
                 var home = Environment.GetEnvironmentVariable("HOME");
                 if (string.IsNullOrEmpty(home))
                 if (string.IsNullOrEmpty(home))
@@ -211,7 +211,7 @@ namespace GodotTools.Ides.Rider
         {
         {
             if (OS.IsWindows || OS.IsUnixLike)
             if (OS.IsWindows || OS.IsUnixLike)
                 return "../../build.txt";
                 return "../../build.txt";
-            if (OS.IsmacOS)
+            if (OS.IsMacOS)
                 return "Contents/Resources/build.txt";
                 return "Contents/Resources/build.txt";
             throw new Exception("Unknown OS.");
             throw new Exception("Unknown OS.");
         }
         }

+ 6 - 6
modules/mono/editor/GodotTools/GodotTools/Utils/OS.cs

@@ -21,7 +21,7 @@ namespace GodotTools.Utils
         public static class Names
         public static class Names
         {
         {
             public const string Windows = "Windows";
             public const string Windows = "Windows";
-            public const string macOS = "macOS";
+            public const string MacOS = "macOS";
             public const string Linux = "Linux";
             public const string Linux = "Linux";
             public const string FreeBSD = "FreeBSD";
             public const string FreeBSD = "FreeBSD";
             public const string NetBSD = "NetBSD";
             public const string NetBSD = "NetBSD";
@@ -37,7 +37,7 @@ namespace GodotTools.Utils
         public static class Platforms
         public static class Platforms
         {
         {
             public const string Windows = "windows";
             public const string Windows = "windows";
-            public const string macOS = "macos";
+            public const string MacOS = "osx";
             public const string LinuxBSD = "linuxbsd";
             public const string LinuxBSD = "linuxbsd";
             public const string Server = "server";
             public const string Server = "server";
             public const string UWP = "uwp";
             public const string UWP = "uwp";
@@ -50,7 +50,7 @@ namespace GodotTools.Utils
         public static readonly Dictionary<string, string> PlatformNameMap = new Dictionary<string, string>
         public static readonly Dictionary<string, string> PlatformNameMap = new Dictionary<string, string>
         {
         {
             [Names.Windows] = Platforms.Windows,
             [Names.Windows] = Platforms.Windows,
-            [Names.macOS] = Platforms.macOS,
+            [Names.MacOS] = Platforms.MacOS,
             [Names.Linux] = Platforms.LinuxBSD,
             [Names.Linux] = Platforms.LinuxBSD,
             [Names.FreeBSD] = Platforms.LinuxBSD,
             [Names.FreeBSD] = Platforms.LinuxBSD,
             [Names.NetBSD] = Platforms.LinuxBSD,
             [Names.NetBSD] = Platforms.LinuxBSD,
@@ -77,11 +77,11 @@ namespace GodotTools.Utils
             new[] {Names.Linux, Names.FreeBSD, Names.NetBSD, Names.BSD};
             new[] {Names.Linux, Names.FreeBSD, Names.NetBSD, Names.BSD};
 
 
         private static readonly IEnumerable<string> UnixLikePlatforms =
         private static readonly IEnumerable<string> 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();
                 .Concat(LinuxBSDPlatforms).ToArray();
 
 
         private static readonly Lazy<bool> _isWindows = new Lazy<bool>(() => IsOS(Names.Windows));
         private static readonly Lazy<bool> _isWindows = new Lazy<bool>(() => IsOS(Names.Windows));
-        private static readonly Lazy<bool> _ismacOS = new Lazy<bool>(() => IsOS(Names.macOS));
+        private static readonly Lazy<bool> _isMacOS = new Lazy<bool>(() => IsOS(Names.MacOS));
         private static readonly Lazy<bool> _isLinuxBSD = new Lazy<bool>(() => IsAnyOS(LinuxBSDPlatforms));
         private static readonly Lazy<bool> _isLinuxBSD = new Lazy<bool>(() => IsAnyOS(LinuxBSDPlatforms));
         private static readonly Lazy<bool> _isServer = new Lazy<bool>(() => IsOS(Names.Server));
         private static readonly Lazy<bool> _isServer = new Lazy<bool>(() => IsOS(Names.Server));
         private static readonly Lazy<bool> _isUWP = new Lazy<bool>(() => IsOS(Names.UWP));
         private static readonly Lazy<bool> _isUWP = new Lazy<bool>(() => IsOS(Names.UWP));
@@ -92,7 +92,7 @@ namespace GodotTools.Utils
         private static readonly Lazy<bool> _isUnixLike = new Lazy<bool>(() => IsAnyOS(UnixLikePlatforms));
         private static readonly Lazy<bool> _isUnixLike = new Lazy<bool>(() => IsAnyOS(UnixLikePlatforms));
 
 
         public static bool IsWindows => _isWindows.Value || IsUWP;
         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 IsLinuxBSD => _isLinuxBSD.Value;
         public static bool IsServer => _isServer.Value;
         public static bool IsServer => _isServer.Value;
         public static bool IsUWP => _isUWP.Value;
         public static bool IsUWP => _isUWP.Value;